projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e56f22a
)
Filter and sort videos before calling list_formats
author
rzhxeo
<rzhxeot7z81b4700@mailcatch.com>
Wed, 18 Dec 2013 20:24:39 +0000
(21:24 +0100)
committer
rzhxeo
<rzhxeot7z81b4700@mailcatch.com>
Wed, 18 Dec 2013 20:24:39 +0000
(21:24 +0100)
youtube_dl/YoutubeDL.py
patch
|
blob
|
history
diff --git
a/youtube_dl/YoutubeDL.py
b/youtube_dl/YoutubeDL.py
index 74c0db4fc2a0e4d0f54a74187357e6bb05d7f09d..fd26f00b721c05f8889ad07ad9e119451ab96251 100644
(file)
--- a/
youtube_dl/YoutubeDL.py
+++ b/
youtube_dl/YoutubeDL.py
@@
-662,10
+662,6
@@
class YoutubeDL(object):
if 'ext' not in format:
format['ext'] = determine_ext(format['url'])
if 'ext' not in format:
format['ext'] = determine_ext(format['url'])
- if self.params.get('listformats', None):
- self.list_formats(info_dict)
- return
-
format_limit = self.params.get('format_limit', None)
if format_limit:
formats = list(takewhile_inclusive(
format_limit = self.params.get('format_limit', None)
if format_limit:
formats = list(takewhile_inclusive(
@@
-681,6
+677,11
@@
class YoutubeDL(object):
return (f.get('height'), f.get('width'), ext_ord)
formats = sorted(formats, key=_free_formats_key)
return (f.get('height'), f.get('width'), ext_ord)
formats = sorted(formats, key=_free_formats_key)
+ info_dict['formats'] = formats
+ if self.params.get('listformats', None):
+ self.list_formats(info_dict)
+ return
+
req_format = self.params.get('format', 'best')
if req_format is None:
req_format = 'best'
req_format = self.params.get('format', 'best')
if req_format is None:
req_format = 'best'