diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2013-12-26 21:05:30 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2013-12-26 21:05:30 +0100 |
commit | 4bc60dafebb34fc8a403b57818bb2f1660218818 (patch) | |
tree | 186e2308ba1e82f2d35e836bf3c2d197535fcdae /youtube_dl | |
parent | bf5b0a1bfb3d875cb3ccd2fc834efd7343885bd2 (diff) | |
download | youtube-dl-4bc60dafebb34fc8a403b57818bb2f1660218818.zip youtube-dl-4bc60dafebb34fc8a403b57818bb2f1660218818.tar.gz youtube-dl-4bc60dafebb34fc8a403b57818bb2f1660218818.tar.bz2 |
[blinkx] Use centralized format sorting
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/extractor/blinkx.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/youtube_dl/extractor/blinkx.py b/youtube_dl/extractor/blinkx.py index 144ce64..0229840 100644 --- a/youtube_dl/extractor/blinkx.py +++ b/youtube_dl/extractor/blinkx.py @@ -61,9 +61,10 @@ class BlinkxIE(InfoExtractor): elif m['type'] in ('flv', 'mp4'): vcodec = remove_start(m['vcodec'], 'ff') acodec = remove_start(m['acodec'], 'ff') + tbr = (int(m['vbr']) + int(m['abr'])) // 1000 format_id = (u'%s-%sk-%s' % (vcodec, - (int(m['vbr']) + int(m['abr'])) // 1000, + tbr, m['w'])) formats.append({ 'format_id': format_id, @@ -72,10 +73,12 @@ class BlinkxIE(InfoExtractor): 'acodec': acodec, 'abr': int(m['abr']) // 1000, 'vbr': int(m['vbr']) // 1000, + 'tbr': tbr, 'width': int(m['w']), 'height': int(m['h']), }) - formats.sort(key=lambda f: (f['width'], f['vbr'], f['abr'])) + + self._sort_formats(formats) return { 'id': display_id, |