[common] fail only if the extractor didn't return formats

This commit is contained in:
remitamine 2015-12-29 23:35:27 +01:00
parent 453fe2a345
commit f3a95abbfc
2 changed files with 3 additions and 1 deletions

View File

@ -1208,6 +1208,8 @@ class YoutubeDL(object):
raise ExtractorError('Missing "id" field in extractor result')
if 'title' not in info_dict:
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:
# It isn't part of a playlist

View File

@ -765,7 +765,7 @@ class InfoExtractor(object):
def _sort_formats(self, formats, field_preference=None):
if not formats:
raise ExtractorError('No video formats found')
return
def _formats_key(f):
# TODO remove the following workaround