aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/mixch.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-12-27 03:01:08 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-12-27 03:01:22 +0530
commit9012d20b23b01827c8d75b460da22485c5cc80ef (patch)
tree0196eb7120f19f297a0e43c3ffc11952a0062f3d /yt_dlp/extractor/mixch.py
parentd61ef7f34395eae33810ec16397f86c54bf06af6 (diff)
downloadhypervideo-pre-9012d20b23b01827c8d75b460da22485c5cc80ef.tar.lz
hypervideo-pre-9012d20b23b01827c8d75b460da22485c5cc80ef.tar.xz
hypervideo-pre-9012d20b23b01827c8d75b460da22485c5cc80ef.zip
[extractor/mixch] Support `--wait-for-video`
Diffstat (limited to 'yt_dlp/extractor/mixch.py')
-rw-r--r--yt_dlp/extractor/mixch.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/yt_dlp/extractor/mixch.py b/yt_dlp/extractor/mixch.py
index 3f430a717..7eedbc752 100644
--- a/yt_dlp/extractor/mixch.py
+++ b/yt_dlp/extractor/mixch.py
@@ -32,8 +32,10 @@ class MixchIE(InfoExtractor):
initial_js_state = self._parse_json(self._search_regex(
r'(?m)^\s*window\.__INITIAL_JS_STATE__\s*=\s*(\{.+?\});\s*$', webpage, 'initial JS state'), video_id)
- if not initial_js_state.get('liveInfo'):
- raise ExtractorError('Livestream has ended.', expected=True)
+
+ is_live = initial_js_state.get('liveInfo')
+ if not is_live:
+ self.raise_no_formats('Livestream has ended or has not started', expected=True)
return {
'id': video_id,
@@ -48,8 +50,8 @@ class MixchIE(InfoExtractor):
'url': traverse_obj(initial_js_state, ('liveInfo', 'hls')) or 'https://d1hd0ww6piyb43.cloudfront.net/hls/torte_%s.m3u8' % video_id,
'ext': 'mp4',
'protocol': 'm3u8',
- }],
- 'is_live': True,
+ }] if is_live else [],
+ 'live_status': 'is_live' if is_live else 'is_upcoming',
}