You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pixiv seems not allowing username/password login now #158
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.
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)
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.
Reacted by Mike Fährmann, Yxa0x0, Mykhailo Danylenko, 神代綺凛, Googleplex, Aaeeschylus, conkerts, Zhou Hao, Juan Lanche, Roy Tam and 26 more
Reacted by shibababa, Zhou Hao, CrackedP0t, lana and ComfyFluffy
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!
Reacted by Googleplex, Roy Tam, bakashigure, Trii Hsia, Sirilerk LAB, mojyack, nabil, Max-Learning, Antony, theBreadCompany and 5 more
Activity
roytam1 commentedon Feb 9, 2021
background information:
In pixiv android Version 5.0.234 in 2021-02-08, there is a line:
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.
roytam1 commentedon Feb 9, 2021
a cross reference is found: #140 (comment)
kilosonc commentedon Feb 9, 2021
I encountered the same problem
I want to use
set_auth, but I don't know which is access token, there're to many pairs incookieroytam1 commentedon Feb 9, 2021
they're not exist in cookies or IndexedDB or Local Storage.
evazion commentedon Feb 10, 2021
In my project I had to revert back to using the Ajax API. The problem is that the
grant_type=passwordauthentication 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
emesh0620 commentedon Feb 10, 2021
If password authentication is disabled, is there no choice but to scrape with BeautifulSoup from now on? Unbelievable
Mouwoo commentedon Feb 10, 2021
经测试该账号和密码可以pixiv官网正常登录
emesh0620 commentedon Feb 10, 2021
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
Fix Pixiv.
sirilerklab commentedon Feb 11, 2021
Pixiv was changed grant_type password to authorization_code. But it's so hard to login because pixiv using login with OAuth 2.0

ZipFile commentedon Feb 11, 2021
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
codeparam from the url.upbit commentedon Feb 12, 2021
Not being able to login with
passwordis 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!
farmerswalker commentedon Feb 12, 2021
pixiv seems not allowing username/password login now #158😢😢
It's really sad..😢
Is there any solutions yet?
18 remaining items
reimu1234 commentedon Feb 24, 2021
请问手机端能拿到吗 pc 的试了拿到code后就过不去了 开了全局
upbit commentedon Feb 24, 2021
如果能输出code,可以参考requests的代理配置,对95行的post请求增加代理
reimu1234 commentedon Feb 24, 2021
都试了才来打扰😂
upbit commentedon Feb 24, 2021
试试换个代理?这个和ZipFile的原始脚本一样,都用requests直接请求的。或者试下 Mapaler 的GUI工具
ps: 手机端没试过,如果你用term跑python应该可以;纯浏览器会打开app,无法拦截code
Mapaler commentedon Feb 24, 2021
@yzwik 手机端用浏览器获取code会打开P站APP,除非你把P站APP卸载掉,自己写一个注册pixiv协议的APP来获取code。
获取的登陆code只有几十秒的生存时间,需要尽快使用,不然就过期了。你电脑获取的话,需要马上转移到手机上使用。
或者你可以电脑上登陆了后,把刷新code拿去直接添加刷新code,刷新code的生存时间非常长。
txperl commentedon Feb 24, 2021
可以通过 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
reimu1234 commentedon Feb 25, 2021
确实是代理的问题 换了个节点解决😂 感谢大佬帮助
Implement REFRESH_TOKEN based Pixiv Auth
0.1.0: Refactoring (#1)
TianyiShi2001 commentedon Mar 8, 2021
如果是有reCAPTCHA的话那就不可能全自动了吧
不过cookie不是太快过期的话倒也不太影响使用
eggplants commentedon Aug 28, 2021
I have written a library/CLI based on this script to get tokens headlessly in selenium.
Check: https://github.com/eggplants/get-pixivpy-token
feat(auth): Added API authentication process.
[pixiv] update (mikf#1304)