projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bfaae0a
)
Make prefer_free_formats sorting more robust
author
rzhxeo
<rzhxeot7z81b4700@mailcatch.com>
Wed, 18 Dec 2013 20:25:13 +0000
(21:25 +0100)
committer
rzhxeo
<rzhxeot7z81b4700@mailcatch.com>
Wed, 18 Dec 2013 20:25:13 +0000
(21:25 +0100)
youtube_dl/YoutubeDL.py
patch
|
blob
|
history
diff --git
a/youtube_dl/YoutubeDL.py
b/youtube_dl/YoutubeDL.py
index fd26f00b721c05f8889ad07ad9e119451ab96251..a93dd41a315ce49f3d7325249fa1b267d8565ee7 100644
(file)
--- a/
youtube_dl/YoutubeDL.py
+++ b/
youtube_dl/YoutubeDL.py
@@
-674,7
+674,9
@@
class YoutubeDL(object):
except ValueError:
ext_ord = -1
# We only compare the extension if they have the same height and width
- return (f.get('height'), f.get('width'), ext_ord)
+ 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,
+ ext_ord)
formats = sorted(formats, key=_free_formats_key)
info_dict['formats'] = formats