From a6bcaf71fc94b2f301d4253ecea87ea2ff76fedb Mon Sep 17 00:00:00 2001 From: pukkandan Date: Sun, 31 Jul 2022 03:19:50 +0530 Subject: [PATCH] [outtmpl] Treat empty values as None in filenames Workaround for #4485 --- yt_dlp/YoutubeDL.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py index e9a51cba4..ce8ac2e89 100644 --- a/yt_dlp/YoutubeDL.py +++ b/yt_dlp/YoutubeDL.py @@ -1162,6 +1162,9 @@ def get_value(mdict): if mdict['strf_format']: value = strftime_or_none(value, mdict['strf_format'].replace('\\,', ',')) + # XXX: Workaround for https://github.com/yt-dlp/yt-dlp/issues/4485 + if sanitize and value == '': + value = None return value na = self.params.get('outtmpl_na_placeholder', 'NA')