1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-01-24 06:15:39 +08:00

[seznamzpravy] Add more metadata for SDN streams

This commit is contained in:
Ondřej Caletka 2017-12-19 14:07:06 +01:00
parent d4be9c663e
commit 0b74f2f934

View File

@ -44,12 +44,21 @@ class SeznamZpravyIE(InfoExtractor):
width, height = fmtdata.get('resolution')
except (TypeError, ValueError):
width, height = None, None
tbr = int_or_none(fmtdata['bandwidth'])
if tbr:
tbr = int(tbr / 1000)
duration = int_or_none(fmtdata['duration'])
if duration:
duration = int(duration / 1000)
formats.append({
'format_id': fmt,
'width': int_or_none(width),
'height': int_or_none(height),
'url': urljoin(sdn_url, relative_url),
'vcodec': fmtdata.get('codec'),
'tbr': tbr,
'duration': duration,
})
playlists = sdn_data.get('pls', {})