]> jfr.im git - yt-dlp.git/commitdiff
[postprocessor] Fix `_restrict_to` when a codec is not set
authorpukkandan <redacted>
Sun, 13 Jun 2021 20:35:57 +0000 (02:05 +0530)
committerpukkandan <redacted>
Mon, 14 Jun 2021 08:39:22 +0000 (14:09 +0530)
yt_dlp/postprocessor/common.py

index 7fd14ea1e9aff5580da7ab47515eda2f8d58e99c..e8577c9ee42ef941a73917f8e66bb1e2b8da6d21 100644 (file)
@@ -76,8 +76,8 @@ def decorator(func):
             @functools.wraps(func)
             def wrapper(self, info):
                 format_type = (
-                    'video' if info['vcodec'] != 'none'
-                    else 'audio' if info['acodec'] != 'none'
+                    'video' if info.get('vcodec') != 'none'
+                    else 'audio' if info.get('acodec') != 'none'
                     else 'images')
                 if allowed[format_type]:
                     return func(self, info)