summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/oauth.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/extractor/oauth.py')
-rw-r--r--gallery_dl/extractor/oauth.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/gallery_dl/extractor/oauth.py b/gallery_dl/extractor/oauth.py
index 6812f35..428f772 100644
--- a/gallery_dl/extractor/oauth.py
+++ b/gallery_dl/extractor/oauth.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright 2017-2021 Mike Fährmann
+# Copyright 2017-2022 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -399,7 +399,7 @@ class OAuthPixiv(OAuthBase):
if "error" in data:
print(data)
- if data["error"] == "invalid_request":
+ if data["error"] in ("invalid_request", "invalid_grant"):
print("'code' expired, try again")
return
@@ -417,6 +417,10 @@ class OAuthPixiv(OAuthBase):
2) Login
3) Select the last network monitor entry ('callback?state=...')
4) Copy its 'code' query parameter, paste it below, and press Enter
+
+- This 'code' will expire 30 seconds after logging in.
+- Copy-pasting more than just the 'code' value will work as well,
+ like the entire URL or several query parameters.
""")
code = input("code: ")
return code.rpartition("=")[2].strip()