aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-11-13 08:24:00 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-11-13 10:56:06 +0530
commitd7b460d0e5fc710950582baed2e3fc616ed98a80 (patch)
treeda58e8bfb399a8fe2a143c0aaf1bc96f74025ba5
parent171a31dbe8b59b3bab6a9b0712594228ee1b5234 (diff)
downloadhypervideo-pre-d7b460d0e5fc710950582baed2e3fc616ed98a80.tar.lz
hypervideo-pre-d7b460d0e5fc710950582baed2e3fc616ed98a80.tar.xz
hypervideo-pre-d7b460d0e5fc710950582baed2e3fc616ed98a80.zip
Make early reject of `--match-filter` stricter
Closes #5509
-rw-r--r--yt_dlp/YoutubeDL.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py
index 32bd5b3dc..525d3ab6e 100644
--- a/yt_dlp/YoutubeDL.py
+++ b/yt_dlp/YoutubeDL.py
@@ -1358,10 +1358,18 @@ class YoutubeDL:
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']