projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bf5b0a1
)
[blinkx] Use centralized format sorting
author
Philipp Hagemeister
<phihag@phihag.de>
Thu, 26 Dec 2013 20:05:30 +0000
(21:05 +0100)
committer
Philipp Hagemeister
<phihag@phihag.de>
Thu, 26 Dec 2013 20:05:30 +0000
(21:05 +0100)
youtube_dl/extractor/blinkx.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/blinkx.py
b/youtube_dl/extractor/blinkx.py
index 144ce64ccacd35abbbf51392e192dff8a1ca1649..0229840a3017e2e19fea6a895351fb8299beefd8 100644
(file)
--- 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')
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,
format_id = (u'%s-%sk-%s' %
(vcodec,
-
(int(m['vbr']) + int(m['abr'])) // 1000
,
+
tbr
,
m['w']))
formats.append({
'format_id': format_id,
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,
'acodec': acodec,
'abr': int(m['abr']) // 1000,
'vbr': int(m['vbr']) // 1000,
+ 'tbr': tbr,
'width': int(m['w']),
'height': int(m['h']),
})
'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,
return {
'id': display_id,