1
0
mirror of https://github.com/l1ving/youtube-dl synced 2026-06-07 01:43:32 +08:00

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

This commit is contained in:
remitamine
2015-12-29 23:35:27 +01:00
Unverified
parent 453fe2a345
commit f3a95abbfc
2 changed files with 3 additions and 1 deletions
+2
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
+1 -1
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