]> jfr.im git - yt-dlp.git/commitdiff
Make early reject of `--match-filter` stricter
authorpukkandan <redacted>
Sun, 13 Nov 2022 02:54:00 +0000 (08:24 +0530)
committerpukkandan <redacted>
Sun, 13 Nov 2022 05:26:06 +0000 (10:56 +0530)
Closes #5509

yt_dlp/YoutubeDL.py

index 32bd5b3dc888a4b50b1eefe6cae943aa69616968..525d3ab6e57e97212bda3a1752c9706c2cacc8b1 100644 (file)
@@ -1358,10 +1358,18 @@ def prepare_filename(self, info_dict, dir_type='', *, outtmpl=None, warn=False):
 
     def _match_entry(self, info_dict, incomplete=False, silent=False):
         """ Returns None if the file should be downloaded """
+        _type = info_dict.get('_type', 'video')
+        assert incomplete or _type == 'video', 'Only video result can be considered complete'
 
         video_title = info_dict.get('title', info_dict.get('id', 'entry'))
 
         def check_filter():
+            if _type in ('playlist', 'multi_video'):
+                return
+            elif _type in ('url', 'url_transparent') and not try_call(
+                    lambda: self.get_info_extractor(info_dict['ie_key']).is_single_video(info_dict['url'])):
+                return
+
             if 'title' in info_dict:
                 # This can happen when we're just evaluating the playlist
                 title = info_dict['title']