mirror of
https://github.com/yt-dlp/yt-dlp
synced 2025-07-01 03:22:52 -05:00
[YoutubeDL] format spec: Do not fail when a filter gives an empty result
For example with 'best[height<40]' we ended getting a 'IndexError: list index out of range'.
This commit is contained in:
@ -1005,6 +1005,9 @@ class YoutubeDL(object):
|
||||
format_spec = selector.selector
|
||||
|
||||
def selector_function(formats):
|
||||
formats = list(formats)
|
||||
if not formats:
|
||||
return
|
||||
if format_spec == 'all':
|
||||
for f in formats:
|
||||
yield f
|
||||
|
Reference in New Issue
Block a user