mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 15:16:52 +01:00
Fix mergeall
when requested formats are unavailable
This commit is contained in:
parent
f7ad71607d
commit
e01d6aa435
@ -1637,7 +1637,7 @@ def selector_function(ctx):
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
elif selector.type == SINGLE: # atom
|
elif selector.type == SINGLE: # atom
|
||||||
format_spec = (selector.selector if selector.selector is not None else 'best').lower()
|
format_spec = (selector.selector or 'best').lower()
|
||||||
|
|
||||||
# TODO: Add allvideo, allaudio etc by generalizing the code with best/worst selector
|
# TODO: Add allvideo, allaudio etc by generalizing the code with best/worst selector
|
||||||
if format_spec == 'all':
|
if format_spec == 'all':
|
||||||
@ -1649,6 +1649,8 @@ def selector_function(ctx):
|
|||||||
elif format_spec == 'mergeall':
|
elif format_spec == 'mergeall':
|
||||||
def selector_function(ctx):
|
def selector_function(ctx):
|
||||||
formats = list(ctx['formats'])
|
formats = list(ctx['formats'])
|
||||||
|
if not formats:
|
||||||
|
return
|
||||||
merged_format = formats[0]
|
merged_format = formats[0]
|
||||||
for f in formats[1:]:
|
for f in formats[1:]:
|
||||||
merged_format = _merge((merged_format, f))
|
merged_format = _merge((merged_format, f))
|
||||||
|
Loading…
Reference in New Issue
Block a user