aboutsummaryrefslogtreecommitdiff
path: root/yt_dlp/extractor/pixivsketch.py
diff options
context:
space:
mode:
Diffstat (limited to 'yt_dlp/extractor/pixivsketch.py')
-rw-r--r--yt_dlp/extractor/pixivsketch.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/yt_dlp/extractor/pixivsketch.py b/yt_dlp/extractor/pixivsketch.py
index 344cdb3d0..50b7af535 100644
--- a/yt_dlp/extractor/pixivsketch.py
+++ b/yt_dlp/extractor/pixivsketch.py
@@ -1,4 +1,5 @@
from .common import InfoExtractor
+from ..networking.exceptions import HTTPError
from ..utils import (
ExtractorError,
traverse_obj,
@@ -110,8 +111,8 @@ class PixivSketchUserIE(PixivSketchBaseIE):
if not traverse_obj(data, 'is_broadcasting'):
try:
self._call_api(user_id, 'users/current.json', url, 'Investigating reason for request failure')
- except ExtractorError as ex:
- if ex.cause and ex.cause.code == 401:
+ except ExtractorError as e:
+ if isinstance(e.cause, HTTPError) and e.cause.status == 401:
self.raise_login_required(f'Please log in, or use direct link like https://sketch.pixiv.net/@{user_id}/1234567890', method='cookies')
raise ExtractorError('This user is offline', expected=True)