fix: default to False for params["windowsfilenames"] when absent

pull/8464/head
NiChrosia 7 months ago
parent 773b554bf5
commit 0ed18251d2

@ -1255,7 +1255,7 @@ class YoutubeDL:
def filename_sanitizer(key, value, restricted=self.params.get('restrictfilenames')):
return sanitize_filename(
str(value), self.params["windowsfilenames"], restricted=restricted, is_id=(
str(value), self.params.get("windowsfilenames", False), restricted=restricted, is_id=(
bool(re.search(r'(^|[_.])id(\.|$)', key))
if 'filename-sanitization' in self.params['compat_opts']
else NO_DEFAULT))

@ -958,7 +958,7 @@ class InfoExtractor:
if len(basen) > trim_length:
h = '___' + hashlib.md5(basen.encode('utf-8')).hexdigest()
basen = basen[:trim_length - len(h)] + h
filename = sanitize_filename(f'{basen}.dump', self.get_param("windowsfilenames"), restricted=True)
filename = sanitize_filename(f'{basen}.dump', self.get_param("windowsfilenames", False), restricted=True)
# Working around MAX_PATH limitation on Windows (see
# http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx)
if compat_os_name == 'nt':

Loading…
Cancel
Save