[common] fail only if the extractor didn't return formats
This commit is contained in:
parent
453fe2a345
commit
f3a95abbfc
@ -1208,6 +1208,8 @@ class YoutubeDL(object):
|
|||||||
raise ExtractorError('Missing "id" field in extractor result')
|
raise ExtractorError('Missing "id" field in extractor result')
|
||||||
if 'title' not in info_dict:
|
if 'title' not in info_dict:
|
||||||
raise ExtractorError('Missing "title" field in extractor result')
|
raise ExtractorError('Missing "title" field in extractor result')
|
||||||
|
if not info_dict.get('formats'):
|
||||||
|
raise ExtractorError('No video formats found')
|
||||||
|
|
||||||
if 'playlist' not in info_dict:
|
if 'playlist' not in info_dict:
|
||||||
# It isn't part of a playlist
|
# It isn't part of a playlist
|
||||||
|
@ -765,7 +765,7 @@ class InfoExtractor(object):
|
|||||||
|
|
||||||
def _sort_formats(self, formats, field_preference=None):
|
def _sort_formats(self, formats, field_preference=None):
|
||||||
if not formats:
|
if not formats:
|
||||||
raise ExtractorError('No video formats found')
|
return
|
||||||
|
|
||||||
def _formats_key(f):
|
def _formats_key(f):
|
||||||
# TODO remove the following workaround
|
# TODO remove the following workaround
|
||||||
|
Loading…
x
Reference in New Issue
Block a user