[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:
parent
f5f4a27a96
commit
bb8e553662
2 changed files with 11 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue