aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-12-27 10:13:22 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-12-27 11:45:22 +0530
commit4af47a00038dfbe6a243119e499f2e876e0f2766 (patch)
treea06d9b677e085e7859226016b4e157a842feed3b
parent9012d20b23b01827c8d75b460da22485c5cc80ef (diff)
downloadhypervideo-pre-4af47a00038dfbe6a243119e499f2e876e0f2766.tar.lz
hypervideo-pre-4af47a00038dfbe6a243119e499f2e876e0f2766.tar.xz
hypervideo-pre-4af47a00038dfbe6a243119e499f2e876e0f2766.zip
Fix 9012d20b23b01827c8d75b460da22485c5cc80ef
-rw-r--r--yt_dlp/extractor/mixch.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/yt_dlp/extractor/mixch.py b/yt_dlp/extractor/mixch.py
index 7eedbc752..4be694728 100644
--- a/yt_dlp/extractor/mixch.py
+++ b/yt_dlp/extractor/mixch.py
@@ -1,8 +1,5 @@
from .common import InfoExtractor
-from ..utils import (
- ExtractorError,
- traverse_obj,
-)
+from ..utils import UserNotLive, traverse_obj
class MixchIE(InfoExtractor):
@@ -32,10 +29,8 @@ 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)
-
- is_live = initial_js_state.get('liveInfo')
- if not is_live:
- self.raise_no_formats('Livestream has ended or has not started', expected=True)
+ if not initial_js_state.get('liveInfo'):
+ raise UserNotLive(video_id=video_id)
return {
'id': video_id,
@@ -47,11 +42,12 @@ class MixchIE(InfoExtractor):
'uploader_id': video_id,
'formats': [{
'format_id': 'hls',
- 'url': traverse_obj(initial_js_state, ('liveInfo', 'hls')) or 'https://d1hd0ww6piyb43.cloudfront.net/hls/torte_%s.m3u8' % video_id,
+ 'url': (traverse_obj(initial_js_state, ('liveInfo', 'hls'))
+ or f'https://d1hd0ww6piyb43.cloudfront.net/hls/torte_{video_id}.m3u8'),
'ext': 'mp4',
'protocol': 'm3u8',
- }] if is_live else [],
- 'live_status': 'is_live' if is_live else 'is_upcoming',
+ }],
+ 'is_live': True,
}