Retrieving Auth Token
February 11, 2021 ยท View on GitHub
-
Run the command:
python pixiv_auth.py loginThis will open the browser with Pixiv login page.
-
Open dev console (F12) and switch to network tab.
-
Enable persistent logging ("Preserve log").
-
Type into the filter field:
callback? -
Proceed with Pixiv login.
-
After logging in you should see a blank page and request that looks like this:
https://app-api.pixiv.net/web/v1/users/auth/pixiv/callback?state=...&code=.... Copy value of thecodeparam into thepixiv_auth.py's prompt and hit the Enter key.
If you did everything right and Pixiv did not change their auth flow, pair of auth_token and refresh_token should be displayed.
:warning:
code's lifetime is extremely short, so make sure to minimize delay between step 5 and 6. Otherwise, repeat everything starting step 1.
Refresh Tokens
python pixiv_auth.py refresh OLD_REFRESH_TOKEN