aboutsummaryrefslogtreecommitdiff
path: root/yt_dlp/extractor/pixivsketch.py
diff options
context:
space:
mode:
authorbashonly <88596187+bashonly@users.noreply.github.com>2024-12-03 20:22:21 +0000
committerGitHub <noreply@github.com>2024-12-03 20:22:21 +0000
commit2b67ac300ac8b44368fb121637d1743cea8c5b6b (patch)
tree19ccfa8c942b5741bdc90a7f51d10c082b8743c1 /yt_dlp/extractor/pixivsketch.py
parentc038a7b187ba24360f14134842a7a2cf897c33b1 (diff)
[cleanup] Misc (#11716)
Authored by: bashonly, seproDev Co-authored-by: sepro <sepro@sepr0.com>
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)