Skip to content

Commit

Permalink
Make early reject of --match-filter stricter
Browse files Browse the repository at this point in the history
Closes #5509
  • Loading branch information
pukkandan committed Nov 13, 2022
1 parent 171a31d commit d7b460d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions yt_dlp/YoutubeDL.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down

0 comments on commit d7b460d

Please sign in to comment.