From 7e87e27c52e9c9f0412ab360e560255533d35dce Mon Sep 17 00:00:00 2001 From: pukkandan Date: Mon, 14 Jun 2021 02:05:57 +0530 Subject: [PATCH] [postprocessor] Fix `_restrict_to` when a codec is not set --- yt_dlp/postprocessor/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yt_dlp/postprocessor/common.py b/yt_dlp/postprocessor/common.py index 7fd14ea1e9..e8577c9ee4 100644 --- a/yt_dlp/postprocessor/common.py +++ b/yt_dlp/postprocessor/common.py @@ -76,8 +76,8 @@ class PostProcessor(object): @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)