pixiv: fix API breakage.

Fix the Pixiv API no longer working by rewriting the Pixiv strategy to
use the Ajax API instead of the mobile API.

Before we could authenticate in the mobile API by using the OAuth 2.0
grant_type=password authentication flow. This no longer works. Now it
requires logging in through a HTML page, which is protected by Google
reCaptcha. This makes using the mobile API infeasible.

Instead we switch to the Ajax API, which only needs a PHPSESSID to
authenticate. This can be obtained by logging in manually and using the
devtools to extract the cookie.

This also temporarily removes support for Pixiv novels. This should be
moved to a separate source strategy.
This commit is contained in:
evazion
2021-02-09 05:48:02 -06:00
parent 7520c4db49
commit 39cc3ed5cf
8 changed files with 458 additions and 317 deletions

View File

@@ -289,11 +289,10 @@ module Danbooru
[]
end
def pixiv_login
nil
end
def pixiv_password
# Your Pixiv PHPSESSID cookie. Get this by logging in to Pixiv and using
# the devtools to find the PHPSESSID cookie. This is need for Pixiv upload
# support.
def pixiv_phpsessid
nil
end