[oauth:pixiv] add note about 'code' expiring in 30 seconds (#2306)
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user