1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-26 02:14:32 +01:00

[vbox7] Add support of multiple formats

This commit is contained in:
lsimeonov2 2018-12-30 13:44:11 -05:00
parent 140a13f5de
commit 6963bde436

View File

@ -93,10 +93,28 @@ class Vbox7IE(InfoExtractor):
webpage.replace('"/*@context"', '"@context"'), video_id,
fatal=False)
formats = []
if 'videoIsHD' in video:
resolution = 720
else:
resolution = 480
for resolution in video.get('resolutions', [resolution]):
if 0 == resolution:
continue
format_url = video_url.replace('.mpd', '_' + str(resolution) + '.mp4')
formats.append({
'url': format_url,
'format_id': '%s' % str(resolution),
'height': int(resolution),
'ext': 'mp4'
})
self._sort_formats(formats, field_preference=('height'))
info.update({
'id': video_id,
'title': title,
'url': video_url,
'formats': formats,
'uploader': uploader,
'thumbnail': self._proto_relative_url(
info.get('thumbnail') or self._og_search_thumbnail(webpage),