mirror of
https://codeberg.org/polarisfm/youtube-dl.git
synced 2024-12-26 17:46:45 +00:00
[brightcove] Set the filesize of the formats and use _sort_formats
This commit is contained in:
parent
96bef88f5f
commit
35eacd0dae
1 changed files with 3 additions and 1 deletions
|
@ -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({
|
||||
|
|
Loading…
Reference in a new issue