Skip to content

pixiv seems not allowing username/password login now #158

Open

Description

@roytam1

server returning JSON:

{"has_error":true,"errors":{"system":{"message":"The grant type is unauthorized for this client_id","code":1508}},"error":"invalid_grant"}

Activity

  1. roytam1 commented on Feb 9, 2021

    @roytam1
    Author

    background information:

    In pixiv android Version 5.0.234 in 2021-02-08, there is a line:

    • From the beginning of February 2021, you'll have to update your app to the latest version if you're running ver.5.0.219 or earlier.

    and for testing, I tried to install 5.0.220.1 apk and tried to login, and it pops out custom browser window and jumps to pixiv standard login form.

  2. roytam1 commented on Feb 9, 2021

    @roytam1
    Author

    a cross reference is found: #140 (comment)

  3. kilosonc commented on Feb 9, 2021

    @kilosonc

    I encountered the same problem

    HTTP 400: {"has_error":true,"errors":{"system":{"message":"Invalid grant_type parameter or parameter missing","code":1508}},"error":"invalid_grant"}
    

    I want to use set_auth, but I don't know which is access token, there're to many pairs in cookie

  4. roytam1 commented on Feb 9, 2021

    @roytam1
    Author

    I want to use set_auth, but I don't know which is access token, there're to many pairs in cookie

    they're not exist in cookies or IndexedDB or Local Storage.

  5. evazion commented on Feb 10, 2021

    @evazion

    In my project I had to revert back to using the Ajax API. The problem is that the grant_type=password authentication method is no longer supported. The Pixiv app now logs in through https://accounts.pixiv.net/login, but this page is protected by Google reCAPTCHA, which seems impossible to circumvent.

    I think that as long as you have a refresh token, you can keep using it, but getting one is tricky since you have to login with the mobile app and sniff traffic to get it.

    https://github.com/danbooru/danbooru/blob/39cc3ed5cf913499093d2f641d70d7682a14fa42/app/logical/pixiv_ajax_client.rb

  6. emesh0620 commented on Feb 10, 2021

    @emesh0620

    If password authentication is disabled, is there no choice but to scrape with BeautifulSoup from now on? Unbelievable

  7. Mouwoo commented on Feb 10, 2021

    @Mouwoo

    Screenshot_20210210_155236
    经测试该账号和密码可以pixiv官网正常登录

  8. emesh0620 commented on Feb 10, 2021

    @emesh0620

    Last year, you said that you are trying not to register with a leaked password, but you are also considering methods such as multi-factor authentication, so it is time to think about some fundamental measures. It may be. (Link to Japanese)

    https://inside.pixiv.blog/2020/01/22/180000

  9. added a commit that references this issue on Feb 11, 2021
  10. sirilerklab commented on Feb 11, 2021

    @sirilerklab

    Pixiv was changed grant_type password to authorization_code. But it's so hard to login because pixiv using login with OAuth 2.0
    image

  11. ZipFile commented on Feb 11, 2021

    @ZipFile
    Contributor

    Pixiv now follows RFC7636. We won't be able to use (old) password login again, but there is a way to automate token retrieval without traffic sniffing. I've implemented a simple script to retrieve access/refresh tokens. Right now it requires single manual step inspecting dev console, but in general, entire flow could be fully automated using browser extensions: you can add request handler and extract code param from the url.

  12. upbit commented on Feb 12, 2021

    @upbit
    Owner

    Not being able to login with password is really bad news..
    Thank you all for these new methods. My current network is relatively poor, and the login method will be updated as soon as possible after verification.

    Happy Chinese New Year!

  13. farmerswalker commented on Feb 12, 2021

    @farmerswalker

    pixiv seems not allowing username/password login now #158😢😢
    It's really sad..😢
    Is there any solutions yet?

  14. 18 remaining items

  15. reimu1234 commented on Feb 24, 2021

    @reimu1234

    Update the semi-automatic script, get the code through chromedriver

    更新了半自动脚本,通过chromedriver获取code

    https://github.com/proxy/gist.github.com/upbit/6edda27cb1644e94183291109b8a5fde

    请问手机端能拿到吗 pc 的试了拿到code后就过不去了 开了全局

  16. upbit commented on Feb 24, 2021

    @upbit
    Owner

    Update the semi-automatic script, get the code through chromedriver
    更新了半自动脚本,通过chromedriver获取code
    https://github.com/proxy/gist.github.com/upbit/6edda27cb1644e94183291109b8a5fde

    请问手机端能拿到吗 pc 的试了拿到code后就过不去了 开了全局

    如果能输出code,可以参考requests的代理配置,对95行的post请求增加代理

  17. reimu1234 commented on Feb 24, 2021

    @reimu1234

    Update the semi-automatic script, get the code through chromedriver
    更新了半自动脚本,通过chromedriver获取code
    https://github.com/proxy/gist.github.com/upbit/6edda27cb1644e94183291109b8a5fde

    请问手机端能拿到吗 pc 的试了拿到code后就过不去了 开了全局

    如果能输出code,可以参考requests的代理配置,对95行的post请求增加代理

    都试了才来打扰😂

  18. upbit commented on Feb 24, 2021

    @upbit
    Owner

    试试换个代理?这个和ZipFile的原始脚本一样,都用requests直接请求的。或者试下 Mapaler 的GUI工具

    ps: 手机端没试过,如果你用term跑python应该可以;纯浏览器会打开app,无法拦截code

  19. Mapaler commented on Feb 24, 2021

    @Mapaler

    @yzwik 手机端用浏览器获取code会打开P站APP,除非你把P站APP卸载掉,自己写一个注册pixiv协议的APP来获取code。
    获取的登陆code只有几十秒的生存时间,需要尽快使用,不然就过期了。你电脑获取的话,需要马上转移到手机上使用。
    或者你可以电脑上登陆了后,把刷新code拿去直接添加刷新code,刷新code的生存时间非常长。

  20. txperl commented on Feb 24, 2021

    @txperl
    Contributor

    Update the semi-automatic script, get the code through chromedriver
    更新了半自动脚本,通过chromedriver获取code
    https://github.com/proxy/gist.github.com/upbit/6edda27cb1644e94183291109b8a5fde

    请问手机端能拿到吗 pc 的试了拿到code后就过不去了 开了全局

    如果能输出code,可以参考requests的代理配置,对95行的post请求增加代理

    都试了才来打扰😂

    可以通过 pixivpy bypass SNI 的方式,先获取 API 的真实 IP,然后直接请求,就不需要代理了。

    参考脚本:
    https://github.com/txperl/PixivBiu/blob/24119157facdef4eb31ab6492eb32b583d01c7bf/app/core/biu/login_token.py

    参考实现:
    https://github.com/txperl/PixivBiu/blob/24119157facdef4eb31ab6492eb32b583d01c7bf/app/core/biu/main.py#L164

  21. reimu1234 commented on Feb 25, 2021

    @reimu1234

    试试换个代理?这个和ZipFile的原始脚本一样,都用requests直接请求的。或者试下 Mapaler 的GUI工具

    ps: 手机端没试过,如果你用term跑python应该可以;纯浏览器会打开app,无法拦截code

    确实是代理的问题 换了个节点解决😂 感谢大佬帮助

  22. TianyiShi2001 commented on Mar 8, 2021

    @TianyiShi2001

    如果是有reCAPTCHA的话那就不可能全自动了吧

    不过cookie不是太快过期的话倒也不太影响使用

  23. eggplants commented on Aug 28, 2021

    @eggplants
    Contributor

    https://github.com/proxy/gist.github.com/upbit/6edda27cb1644e94183291109b8a5fde

    I have written a library/CLI based on this script to get tokens headlessly in selenium.
    Check: https://github.com/eggplants/get-pixivpy-token

  24. added a commit that references this issue on Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions