mirror of
https://github.com/l1ving/youtube-dl
synced 2025-03-10 13:57:17 +08:00
[televizeseznam] append width and height if resolution field exists
This commit is contained in:
parent
0ace168cea
commit
4761dbc20e
@ -52,15 +52,18 @@ class TelevizeSeznamIE(InfoExtractor):
|
|||||||
def extract_formats(self, spl_url, play_list, subtitles):
|
def extract_formats(self, spl_url, play_list, subtitles):
|
||||||
formats = []
|
formats = []
|
||||||
for r, v in play_list.items():
|
for r, v in play_list.items():
|
||||||
formats.append({
|
format = {
|
||||||
'format_id': r,
|
'format_id': r,
|
||||||
'url': urljoin(spl_url, v['url']),
|
'url': urljoin(spl_url, v.get('url')),
|
||||||
'width': v['resolution'][0],
|
|
||||||
'height': v['resolution'][1],
|
|
||||||
'protocol': 'https',
|
'protocol': 'https',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'subtitles': subtitles,
|
'subtitles': subtitles,
|
||||||
})
|
}
|
||||||
|
if v.get('resolution'):
|
||||||
|
format.update({ 'width': v['resolution'][0], 'height': v['resolution'][1] })
|
||||||
|
|
||||||
|
formats.append(format)
|
||||||
|
|
||||||
return formats
|
return formats
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user