]> jfr.im git - yt-dlp.git/commitdiff
[outtmpl] Treat empty values as None in filenames
authorpukkandan <redacted>
Sat, 30 Jul 2022 21:49:50 +0000 (03:19 +0530)
committerpukkandan <redacted>
Sat, 30 Jul 2022 21:56:09 +0000 (03:26 +0530)
Workaround for #4485

yt_dlp/YoutubeDL.py

index e9a51cba40bb6ff89dcfd5be47f7ae9fb2506f4c..ce8ac2e89f7fab7feeefa0e0a021653180f1fd4d 100644 (file)
@@ -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')