[formats] Fix best fallback for storyboards

Partial fix for #7478
This commit is contained in:
pukkandan 2023-07-06 18:17:42 +05:30
parent 337734d4a8
commit 906c0bdcd8
No known key found for this signature in database
GPG key ID: 7EEE9E1E817D0A39

View file

@ -2766,11 +2766,8 @@ class YoutubeDL:
formats_to_download = list(format_selector({ formats_to_download = list(format_selector({
'formats': formats, 'formats': formats,
'has_merged_format': any('none' not in (f.get('acodec'), f.get('vcodec')) for f in formats), 'has_merged_format': any('none' not in (f.get('acodec'), f.get('vcodec')) for f in formats),
'incomplete_formats': ( 'incomplete_formats': (all(f.get('vcodec') == 'none' for f in formats) # No formats with video
# All formats are video-only or or all(f.get('acodec') == 'none' for f in formats)), # OR, No formats with audio
all(f.get('vcodec') != 'none' and f.get('acodec') == 'none' for f in formats)
# all formats are audio-only
or all(f.get('vcodec') == 'none' and f.get('acodec') != 'none' for f in formats)),
})) }))
if interactive_format_selection and not formats_to_download: if interactive_format_selection and not formats_to_download:
self.report_error('Requested format is not available', tb=False, is_error=False) self.report_error('Requested format is not available', tb=False, is_error=False)