mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-02-24 01:16:56 +00:00
@@ -936,7 +936,8 @@ class YoutubeDL(object):
|
||||
# If value is an object, sanitize might convert it to a string
|
||||
# So we convert it to repr first
|
||||
value, fmt = repr(value), '%ss' % fmt[:-1]
|
||||
value = sanitize(key, value)
|
||||
if fmt[-1] in 'csr':
|
||||
value = sanitize(key, value)
|
||||
tmpl_dict[key] = value
|
||||
return '%({key}){fmt}'.format(key=key, fmt=fmt)
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user