From 0b74f2f934c30b516d349d44e903e94e117eca5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Caletka?= Date: Tue, 19 Dec 2017 14:07:06 +0100 Subject: [PATCH] [seznamzpravy] Add more metadata for SDN streams --- youtube_dl/extractor/seznamzpravy.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/youtube_dl/extractor/seznamzpravy.py b/youtube_dl/extractor/seznamzpravy.py index 83543e15b..a60861de3 100644 --- a/youtube_dl/extractor/seznamzpravy.py +++ b/youtube_dl/extractor/seznamzpravy.py @@ -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', {})