1
0
Fork 0
mirror of https://gitlab.com/dstftw/youtube-dl.git synced 2020-11-16 09:42:26 +00:00

[ivi] Use centralized format sorting

This commit is contained in:
Philipp Hagemeister 2013-12-26 18:40:09 +01:00
parent bfe9de8510
commit bf5b0a1bfb

View file

@ -84,14 +84,16 @@ class IviIE(InfoExtractor):
result = video_json[u'result'] result = video_json[u'result']
formats = [{'url': x[u'url'], formats = [{
'format_id': x[u'content_format'] 'url': x[u'url'],
'format_id': x[u'content_format'],
'preference': self._known_formats.index(x[u'content_format']),
} for x in result[u'files'] if x[u'content_format'] in self._known_formats] } for x in result[u'files'] if x[u'content_format'] in self._known_formats]
formats.sort(key=lambda fmt: self._known_formats.index(fmt['format_id']))
if len(formats) == 0: self._sort_formats(formats)
self._downloader.report_warning(u'No media links available for %s' % video_id)
return if not formats:
raise ExtractorError(u'No media links available for %s' % video_id)
duration = result[u'duration'] duration = result[u'duration']
compilation = result[u'compilation'] compilation = result[u'compilation']