1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-10-30 14:15:13 +00:00

Fix %d and empty default in outtmpl

Closes #388
This commit is contained in:
pukkandan
2021-06-09 14:43:51 +05:30
parent b5c5d84f60
commit 639f1cea92
4 changed files with 11 additions and 2 deletions

View File

@@ -2107,6 +2107,8 @@ def sanitize_filename(s, restricted=False, is_id=False):
return '_'
return char
if s == '':
return ''
# Handle timestamps
s = re.sub(r'[0-9]+(?::[0-9]+)+', lambda m: m.group(0).replace(':', '_'), s)
result = ''.join(map(replace_insane, s))