diff options
author | Atsushi Watanabe <atsushi.w@ieee.org> | 2023-09-22 08:04:05 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-21 23:04:05 +0000 |
commit | c1d71d0d9f41db5e4306c86af232f5f6220a130b (patch) | |
tree | 2a2c678fa2dd3ef07f9f995fbcc6c5b109781c9c | |
parent | 661c9a1d029296b28e0b2f8be8a72a43abaf6536 (diff) |
[ie/twitcasting] Support `--wait-for-video` (#7975)
Authored by: at-wat
-rw-r--r-- | yt_dlp/extractor/twitcasting.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/yt_dlp/extractor/twitcasting.py b/yt_dlp/extractor/twitcasting.py index 3890d5d8f..540e217fd 100644 --- a/yt_dlp/extractor/twitcasting.py +++ b/yt_dlp/extractor/twitcasting.py @@ -5,8 +5,9 @@ import re from .common import InfoExtractor from ..dependencies import websockets from ..utils import ( - clean_html, ExtractorError, + UserNotLive, + clean_html, float_or_none, get_element_by_class, get_element_by_id, @@ -235,6 +236,9 @@ class TwitCastingLiveIE(InfoExtractor): _TESTS = [{ 'url': 'https://twitcasting.tv/ivetesangalo', 'only_matching': True, + }, { + 'url': 'https://twitcasting.tv/c:unusedlive', + 'expected_exception': 'UserNotLive', }] def _real_extract(self, url): @@ -260,7 +264,7 @@ class TwitCastingLiveIE(InfoExtractor): r'(?s)<a\s+class="tw-movie-thumbnail"\s*href="/[^/]+/movie/(?P<video_id>\d+)"\s*>.+?</a>', webpage, 'current live ID 2', default=None, group='video_id') if not current_live: - raise ExtractorError('The user is not currently live') + raise UserNotLive(video_id=uploader_id) return self.url_result('https://twitcasting.tv/%s/movie/%s' % (uploader_id, current_live)) |