summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/pixiv.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2020-12-30 18:41:48 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2020-12-30 18:41:48 -0500
commit87a5aa088ce33a1196ff409b76a9ea8233bdc634 (patch)
tree7e6155edcc5dd12e40b47ad814b3bc69e65c52fc /gallery_dl/extractor/pixiv.py
parent8f7c87a2697113134c311aaeafd9c919555a2741 (diff)
New upstream version 1.16.1.upstream/1.16.1
Diffstat (limited to 'gallery_dl/extractor/pixiv.py')
-rw-r--r--gallery_dl/extractor/pixiv.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/gallery_dl/extractor/pixiv.py b/gallery_dl/extractor/pixiv.py
index a813d0e..8aee058 100644
--- a/gallery_dl/extractor/pixiv.py
+++ b/gallery_dl/extractor/pixiv.py
@@ -522,6 +522,10 @@ class PixivAppAPI():
@cache(maxage=3600, keyarg=1)
def _login_impl(self, username, password):
+ if not username or not password:
+ raise exception.AuthenticationError(
+ "Username and password required")
+
url = "https://oauth.secure.pixiv.net/auth/token"
data = {
"client_id": self.client_id,
@@ -550,6 +554,7 @@ class PixivAppAPI():
response = self.extractor.request(
url, method="POST", headers=headers, data=data, fatal=False)
if response.status_code >= 400:
+ self.log.debug(response.text)
raise exception.AuthenticationError()
data = response.json()["response"]