Check parts properly inside a format key

This commit is contained in:
Mark Lee 2014-04-15 12:39:00 -07:00
parent 7d33af60cd
commit d7b31b5b35

View File

@ -739,6 +739,11 @@ class YoutubeDL(object):
# We check that all the formats have the format and format_id fields
for i, format in enumerate(formats):
if 'parts' in format:
for j, part in enumerate(format['parts']):
if 'url' not in part:
raise ExtractorError('Missing "url" key in result (index %d, part %d)' % (i, j))
else:
if 'url' not in format:
raise ExtractorError('Missing "url" key in result (index %d)' % i)