diff options
author | rzhxeo <rzhxeot7z81b4700@mailcatch.com> | 2013-12-18 21:24:39 +0100 |
---|---|---|
committer | rzhxeo <rzhxeot7z81b4700@mailcatch.com> | 2013-12-18 21:24:39 +0100 |
commit | bfaae0a768d455112e003f6200edfdafb22affd6 (patch) | |
tree | fce134a38f326e30dd98fa4eaf314e227964d9ed /youtube_dl/YoutubeDL.py | |
parent | e56f22ae203d10ab6d3715bc2dc1c9b927294e50 (diff) |
Filter and sort videos before calling list_formats
Diffstat (limited to 'youtube_dl/YoutubeDL.py')
-rw-r--r-- | youtube_dl/YoutubeDL.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 74c0db4fc..fd26f00b7 100644 --- 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 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( @@ -681,6 +677,11 @@ class YoutubeDL(object): 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' |