aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/turner.py
diff options
context:
space:
mode:
authorLE <llacb47@users.noreply.github.com>2021-06-26 07:44:43 -0400
committerGitHub <noreply@github.com>2021-06-26 17:14:43 +0530
commit1e79316e20c26aeb79712ab3f364147d04e28c9f (patch)
tree0ea0c8248a44257951e5a9c936ddf903375dcbc5 /yt_dlp/extractor/turner.py
parent45261e063bc83516504261910b72c25daf86d4b8 (diff)
downloadhypervideo-pre-1e79316e20c26aeb79712ab3f364147d04e28c9f.tar.lz
hypervideo-pre-1e79316e20c26aeb79712ab3f364147d04e28c9f.tar.xz
hypervideo-pre-1e79316e20c26aeb79712ab3f364147d04e28c9f.zip
[TBS] Support livestreams (#448)
Authored by: llacb47
Diffstat (limited to 'yt_dlp/extractor/turner.py')
-rw-r--r--yt_dlp/extractor/turner.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/yt_dlp/extractor/turner.py b/yt_dlp/extractor/turner.py
index 81229a54b..3d7a348b0 100644
--- a/yt_dlp/extractor/turner.py
+++ b/yt_dlp/extractor/turner.py
@@ -221,6 +221,7 @@ class TurnerBaseIE(AdobePassIE):
}
def _extract_ngtv_info(self, media_id, tokenizer_query, ap_data=None):
+ is_live = ap_data.get('is_live')
streams_data = self._download_json(
'http://medium.ngtv.io/media/%s/tv' % media_id,
media_id)['media']['tv']
@@ -237,11 +238,11 @@ class TurnerBaseIE(AdobePassIE):
'http://token.ngtv.io/token/token_spe',
m3u8_url, media_id, ap_data or {}, tokenizer_query)
formats.extend(self._extract_m3u8_formats(
- m3u8_url, media_id, 'mp4', m3u8_id='hls', fatal=False))
+ m3u8_url, media_id, 'mp4', m3u8_id='hls', live=is_live, fatal=False))
duration = float_or_none(stream_data.get('totalRuntime'))
- if not chapters:
+ if not chapters and not is_live:
for chapter in stream_data.get('contentSegments', []):
start_time = float_or_none(chapter.get('start'))
chapter_duration = float_or_none(chapter.get('duration'))