mirror of
https://github.com/yt-dlp/yt-dlp
synced 2025-06-30 11:02:54 -05:00
[utils] Prevent hyphen at beginning of filename (Fixes #5035)
This commit is contained in:
@ -304,6 +304,8 @@ def sanitize_filename(s, restricted=False, is_id=False):
|
||||
# Common case of "Foreign band name - English song title"
|
||||
if restricted and result.startswith('-_'):
|
||||
result = result[2:]
|
||||
if result.startswith('-'):
|
||||
result = '_' + result[len('-'):]
|
||||
if not result:
|
||||
result = '_'
|
||||
return result
|
||||
|
Reference in New Issue
Block a user