diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2013-12-24 12:25:22 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2013-12-24 12:31:42 +0100 |
commit | 4bcc7bd1f21c479a3ef613e62868a9fe6d9c370f (patch) | |
tree | 06a97cb8f1af463e45ae48652d7ac83a7bd9d9be /youtube_dl/YoutubeDL.py | |
parent | f49d89ee04897b3ec64af74bb9fd94957c42331c (diff) |
Add temporary _sort_formats helper function
Diffstat (limited to 'youtube_dl/YoutubeDL.py')
-rw-r--r-- | youtube_dl/YoutubeDL.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index d0cb52a51..4910a2912 100644 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -676,17 +676,8 @@ class YoutubeDL(object): formats = list(takewhile_inclusive( lambda f: f['format_id'] != format_limit, formats )) - if self.params.get('prefer_free_formats'): - def _free_formats_key(f): - try: - ext_ord = [u'flv', u'mp4', u'webm'].index(f['ext']) - except ValueError: - ext_ord = -1 - # We only compare the extension if they have the same height and width - 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) + + # TODO Central sorting goes here if formats[0] is not info_dict: # only set the 'formats' fields if the original info_dict list them |