aboutsummaryrefslogtreecommitdiff
path: root/yt_dlp/extractor
diff options
context:
space:
mode:
Diffstat (limited to 'yt_dlp/extractor')
-rw-r--r--yt_dlp/extractor/twitch.py5
-rw-r--r--yt_dlp/extractor/youtube.py6
2 files changed, 6 insertions, 5 deletions
diff --git a/yt_dlp/extractor/twitch.py b/yt_dlp/extractor/twitch.py
index a0cb0be02..32cfd8a08 100644
--- a/yt_dlp/extractor/twitch.py
+++ b/yt_dlp/extractor/twitch.py
@@ -12,10 +12,11 @@ from ..compat import (
compat_urllib_parse_urlparse,
)
from ..utils import (
+ ExtractorError,
+ UserNotLive,
base_url,
clean_html,
dict_get,
- ExtractorError,
float_or_none,
int_or_none,
parse_duration,
@@ -940,7 +941,7 @@ class TwitchStreamIE(TwitchBaseIE):
stream = user['stream']
if not stream:
- raise ExtractorError('%s is offline' % channel_name, expected=True)
+ raise UserNotLive(video_id=channel_name)
access_token = self._download_access_token(
channel_name, 'stream', 'channelName')
diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py
index 09e2127e3..c60e5ca53 100644
--- a/yt_dlp/extractor/youtube.py
+++ b/yt_dlp/extractor/youtube.py
@@ -22,6 +22,7 @@ from ..jsinterp import JSInterpreter
from ..utils import (
NO_DEFAULT,
ExtractorError,
+ UserNotLive,
bug_reports_message,
classproperty,
clean_html,
@@ -5383,9 +5384,8 @@ class YoutubeTabIE(YoutubeTabBaseInfoExtractor):
selected_tab_name = 'featured'
requested_tab_name = mobj['tab'][1:]
if 'no-youtube-channel-redirect' not in compat_opts:
- if requested_tab_name == 'live':
- # Live tab should have redirected to the video
- raise ExtractorError('The channel is not currently live', expected=True)
+ if requested_tab_name == 'live': # Live tab should have redirected to the video
+ raise UserNotLive(video_id=mobj['id'])
if requested_tab_name not in ('', selected_tab_name):
redirect_warning = f'The channel does not have a {requested_tab_name} tab'
if not original_tab_name: