projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dbd1988
)
[YoutubeIE] Sort formats by resolution
author
rzhxeo
<rzhxeot7z81b4700@mailcatch.com>
Wed, 18 Dec 2013 20:22:37 +0000
(21:22 +0100)
committer
rzhxeo
<rzhxeot7z81b4700@mailcatch.com>
Wed, 18 Dec 2013 20:22:37 +0000
(21:22 +0100)
youtube_dl/extractor/youtube.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/youtube.py
b/youtube_dl/extractor/youtube.py
index 793df4881db14d14bcdbfd94356862df8901aad5..58d27497002de5467ab08ebb9a2b0188177943e9 100644
(file)
--- a/
youtube_dl/extractor/youtube.py
+++ b/
youtube_dl/extractor/youtube.py
@@
-1432,6
+1432,10
@@
class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
'height': height,
'format_note': note,
})
+ def _formats_key(f):
+ return (f.get('height') if f.get('height') is not None else -1,
+ f.get('width') if f.get('width') is not None else -1)
+ formats = sorted(formats, key=_formats_key)
return {
'id': video_id,