1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-20 01:42:50 +01:00

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

This commit is contained in:
NiChrosia 2023-10-28 14:13:03 -05:00
parent 773b554bf5
commit 0ed18251d2
2 changed files with 2 additions and 2 deletions

View File

@ -1255,7 +1255,7 @@ def get_value(mdict):
def filename_sanitizer(key, value, restricted=self.params.get('restrictfilenames')): def filename_sanitizer(key, value, restricted=self.params.get('restrictfilenames')):
return sanitize_filename( 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)) bool(re.search(r'(^|[_.])id(\.|$)', key))
if 'filename-sanitization' in self.params['compat_opts'] if 'filename-sanitization' in self.params['compat_opts']
else NO_DEFAULT)) else NO_DEFAULT))

View File

@ -958,7 +958,7 @@ def _request_dump_filename(self, url, video_id):
if len(basen) > trim_length: if len(basen) > trim_length:
h = '___' + hashlib.md5(basen.encode('utf-8')).hexdigest() h = '___' + hashlib.md5(basen.encode('utf-8')).hexdigest()
basen = basen[:trim_length - len(h)] + h 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 # Working around MAX_PATH limitation on Windows (see
# http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx) # http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx)
if compat_os_name == 'nt': if compat_os_name == 'nt':