1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-29 05:32:00 +00:00

resolve problem with unpacking operator for <py3.5

This commit is contained in:
Petr Vaněk 2022-02-12 15:02:08 +01:00 committed by dirkf
parent d8adca1b66
commit 85bf26c1d0

View file

@ -6,6 +6,7 @@ from .common import InfoExtractor
from ..utils import ( from ..utils import (
float_or_none, float_or_none,
int_or_none, int_or_none,
merge_dicts,
parse_codecs, parse_codecs,
urljoin, urljoin,
) )
@ -58,7 +59,7 @@ class StreamCZIE(InfoExtractor):
for format_id, stream in streams.items(): for format_id, stream in streams.items():
if not stream.get('url'): if not stream.get('url'):
continue continue
yield { yield merge_dicts({
'format_id': '{}-{}'.format(format_id, ext), 'format_id': '{}-{}'.format(format_id, ext),
'ext': ext, 'ext': ext,
'source_preference': pref, 'source_preference': pref,
@ -67,8 +68,7 @@ class StreamCZIE(InfoExtractor):
'duration': float_or_none(stream.get('duration'), scale=1000), 'duration': float_or_none(stream.get('duration'), scale=1000),
'width': stream.get('resolution', 2 * [0])[0] or None, 'width': stream.get('resolution', 2 * [0])[0] or None,
'height': stream.get('resolution', 2 * [0])[1] or int_or_none(format_id.replace('p', '')), 'height': stream.get('resolution', 2 * [0])[1] or int_or_none(format_id.replace('p', '')),
**parse_codecs(stream.get('codec')), }, parse_codecs(stream.get('codec')))
}
def _real_extract(self, url): def _real_extract(self, url):
display_id, video_id = re.match(self._VALID_URL, url).groups() display_id, video_id = re.match(self._VALID_URL, url).groups()