Don't raise "requested format not available" when just dumping JSON
This commit is contained in:
parent
327c8364f1
commit
34215326bf
@ -1571,7 +1571,7 @@ class YoutubeDL(object):
|
||||
}
|
||||
|
||||
formats_to_download = list(format_selector(ctx))
|
||||
if not formats_to_download:
|
||||
if download and not formats_to_download:
|
||||
raise ExtractorError('requested format not available',
|
||||
expected=True)
|
||||
|
||||
@ -1583,6 +1583,7 @@ class YoutubeDL(object):
|
||||
new_info.update(format)
|
||||
self.process_info(new_info)
|
||||
# We update the info dict with the best quality format (backwards compatibility)
|
||||
if formats_to_download:
|
||||
info_dict.update(formats_to_download[-1])
|
||||
return info_dict
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user