mirror of
https://github.com/l1ving/youtube-dl
synced 2026-06-07 02:23:38 +08:00
Trim and collapse whitespace from filename
This commit is contained in:
@@ -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:]
|
||||
|
||||
Reference in New Issue
Block a user