mirror of
https://github.com/l1ving/youtube-dl
synced 2025-01-26 15:32:54 +08:00
Trim and collapse whitespace from filename
This commit is contained in:
parent
2b4f5e68d1
commit
797c86ad36
@ -359,6 +359,7 @@ def sanitize_filename(s, restricted=False, is_id=False):
|
||||
while '__' in result:
|
||||
result = result.replace('__', '_')
|
||||
result = result.strip('_')
|
||||
result = " ".join(result.split())
|
||||
# Common case of "Foreign band name - English song title"
|
||||
if restricted and result.startswith('-_'):
|
||||
result = result[2:]
|
||||
|
Loading…
Reference in New Issue
Block a user