summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/pixiv.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/extractor/pixiv.py')
-rw-r--r--gallery_dl/extractor/pixiv.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/gallery_dl/extractor/pixiv.py b/gallery_dl/extractor/pixiv.py
index af29c4b..76d4dc4 100644
--- a/gallery_dl/extractor/pixiv.py
+++ b/gallery_dl/extractor/pixiv.py
@@ -143,9 +143,7 @@ class PixivMeExtractor(PixivExtractor):
def items(self):
url = "https://pixiv.me/" + self.account
response = self.request(
- url, method="HEAD", allow_redirects=False, expect=(404,))
- if response.status_code == 404:
- raise exception.NotFoundError("user")
+ url, method="HEAD", allow_redirects=False, notfound="user")
yield Message.Version, 1
yield Message.Queue, response.headers["Location"], {}
@@ -445,7 +443,7 @@ class PixivAppAPI():
data["password"] = password
response = self.extractor.request(
- url, method="POST", data=data, expect=(400,))
+ url, method="POST", data=data, fatal=False)
if response.status_code >= 400:
raise exception.AuthenticationError()
@@ -491,10 +489,9 @@ class PixivAppAPI():
url = "https://app-api.pixiv.net/" + endpoint
self.login()
- response = self.extractor.request(
- url, params=params, expect=range(400, 500))
+ response = self.extractor.request(url, params=params, fatal=False)
- if 200 <= response.status_code < 400:
+ if response.status_code < 400:
return response.json()
if response.status_code == 404:
raise exception.NotFoundError()