mirror of
https://github.com/l1ving/youtube-dl
synced 2026-06-02 11:09:54 +08:00
Strip surrounding whitespace in filenames
Such spaces are annoying enough to deal with, and break external downloaders trying to be smart (such as aria2c). Fixes #20312.
This commit is contained in:
+1
-1
@@ -509,7 +509,7 @@ def sanitize_filename(s, restricted=False, is_id=False):
|
||||
if not is_id:
|
||||
while '__' in result:
|
||||
result = result.replace('__', '_')
|
||||
result = result.strip('_')
|
||||
result = result.strip(' _')
|
||||
# Common case of "Foreign band name - English song title"
|
||||
if restricted and result.startswith('-_'):
|
||||
result = result[2:]
|
||||
|
||||
Reference in New Issue
Block a user