From 0ed18251d2dfa6ac6272e6f3ee8bcb6d209aa4da Mon Sep 17 00:00:00 2001 From: NiChrosia Date: Sat, 28 Oct 2023 14:13:03 -0500 Subject: [PATCH] fix: default to False for params["windowsfilenames"] when absent --- yt_dlp/YoutubeDL.py | 2 +- yt_dlp/extractor/common.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py index 3d88daf37..83bd627dc 100644 --- a/yt_dlp/YoutubeDL.py +++ b/yt_dlp/YoutubeDL.py @@ -1255,7 +1255,7 @@ def get_value(mdict): 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)) diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index 7659081ea..26e3c643f 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -958,7 +958,7 @@ def _request_dump_filename(self, url, video_id): 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':