1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-06-02 10:29:28 +00:00

[mdr] Use centralized format selection

This commit is contained in:
Philipp Hagemeister 2013-12-24 23:34:11 +01:00
parent c7deaa4c74
commit b874fe2da8

View file

@ -52,10 +52,11 @@ class MDRIE(InfoExtractor):
'format_id': u'%s-%d' % (media_type, vbr),
})
formats.append(format)
formats.sort(key=lambda f: (f.get('vbr'), f['abr']))
if not formats:
raise ExtractorError(u'Could not find any valid formats')
self._sort_formats(formats)
return {
'id': video_id,
'title': title,