Skip to content

A feature-rich command-line audio/video downloader

Fix filename sanitization with `--no-windows-filenames` (#11988)

bashonly8346b5491500
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py
index 764baf3a00..178c5b9515 100644
--- a/yt_dlp/YoutubeDL.py
+++ b/yt_dlp/YoutubeDL.py
@@ -1323,7 +1323,7 @@ class YoutubeDL:
elif (sys.platform != 'win32' and not self.params.get('restrictfilenames')
and self.params.get('windowsfilenames') is False):
def sanitize(key, value):
- return value.replace('/', '\u29F8').replace('\0', '')
+ return str(value).replace('/', '\u29F8').replace('\0', '')
else:
def sanitize(key, value):
return filename_sanitizer(key, value, restricted=self.params.get('restrictfilenames'))