diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2013-12-26 21:08:52 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2013-12-26 21:08:52 +0100 |
commit | 12c978739a56b1e81c72416bfab37908e0543832 (patch) | |
tree | c25485935fd5e9e260dccc36418549b4541d3a33 /youtube_dl/extractor/internetvideoarchive.py | |
parent | 4bc60dafebb34fc8a403b57818bb2f1660218818 (diff) |
[internetvideoarchive] Use centralized format sorting
Diffstat (limited to 'youtube_dl/extractor/internetvideoarchive.py')
-rw-r--r-- | youtube_dl/extractor/internetvideoarchive.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/youtube_dl/extractor/internetvideoarchive.py b/youtube_dl/extractor/internetvideoarchive.py index 16a6f73c8..4ddda2f1b 100644 --- a/youtube_dl/extractor/internetvideoarchive.py +++ b/youtube_dl/extractor/internetvideoarchive.py @@ -5,7 +5,6 @@ from ..utils import ( compat_urlparse, compat_urllib_parse, xpath_with_ns, - determine_ext, ) @@ -63,13 +62,17 @@ class InternetVideoArchiveIE(InfoExtractor): for content in item.findall(_bp('media:group/media:content')): attr = content.attrib f_url = attr['url'] + width = int(attr['width']) + bitrate = int(attr['bitrate']) + format_id = '%d-%dk' % (width, bitrate) formats.append({ + 'format_id': format_id, 'url': f_url, - 'ext': determine_ext(f_url), - 'width': int(attr['width']), - 'bitrate': int(attr['bitrate']), + 'width': width, + 'tbr': bitrate, }) - formats = sorted(formats, key=lambda f: f['bitrate']) + + self._sort_formats(formats) return { 'id': video_id, |