diff options
author | Jaime Marquínez Ferrándiz <[email protected]> | 2014-06-15 11:37:39 +0200 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <[email protected]> | 2014-06-15 11:37:39 +0200 |
commit | 35eacd0dae3b6266d379bb511d0ac321f401fba5 (patch) | |
tree | b0dc809dd0757fa8b26d0dd2681fa537578db0a0 /youtube_dl | |
parent | 96bef88f5f0eea0b2c5410a6cbb65cc820d72b30 (diff) | |
download | youtube-dl-35eacd0dae3b6266d379bb511d0ac321f401fba5.tar.gz youtube-dl-35eacd0dae3b6266d379bb511d0ac321f401fba5.zip |
[brightcove] Set the filesize of the formats and use _sort_formats
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/extractor/brightcove.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/youtube_dl/extractor/brightcove.py b/youtube_dl/extractor/brightcove.py index acf8b2dc2..419951b62 100644 --- a/youtube_dl/extractor/brightcove.py +++ b/youtube_dl/extractor/brightcove.py @@ -235,7 +235,6 @@ class BrightcoveIE(InfoExtractor): renditions = video_info.get('renditions') if renditions: - renditions = sorted(renditions, key=lambda r: r['size']) formats = [] for rend in renditions: url = rend['defaultURL'] @@ -246,12 +245,15 @@ class BrightcoveIE(InfoExtractor): ext = 'flv' else: ext = determine_ext(url) + size = rend.get('size') formats.append({ 'url': url, 'ext': ext, 'height': rend.get('frameHeight'), 'width': rend.get('frameWidth'), + 'filesize': size if size != 0 else None, }) + self._sort_formats(formats) info['formats'] = formats elif video_info.get('FLVFullLengthURL') is not None: info.update({ |