Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

特定账号 refresh_token 失效,一直无法刷新 token #374

Open
NahidaBuer opened this issue Dec 10, 2024 · 1 comment
Open

特定账号 refresh_token 失效,一直无法刷新 token #374

NahidaBuer opened this issue Dec 10, 2024 · 1 comment
Labels

Comments

@NahidaBuer
Copy link

仅描述现象,不知道有没有遇到类似情况的。

......
  File "/usr/local/lib/python3.10/dist-packages/pixivpy3/api.py", line 164, in auth
    raise PixivError(
pixivpy3.utils.PixivError: [ERROR] auth() failed! check refresh_token.
HTTP 400: {"has_error":true,"errors":{"system":{"message":"Invalid refresh token","code":1508}},"error":"invalid_grant"}

尝试用 pixiv_auth.py

python .\pixiv_auth.py login
code: gUAfs1******KCc
access_token: PfuzK2M******TtSFeyTU
refresh_token: edaWxT2******oMAl8g
expires_in: 3600

python .\pixiv_auth.py refresh edaWxT2******oMAl8g
error:
{'error': 'invalid_grant',
 'errors': {'system': {'code': 1508, 'message': 'Invalid refresh token'}},
 'has_error': True}

今天遇到一个玄学问题,不知道是不是风控。有个账号之前用来开通 Premium 和朋友一起共享,偶尔也用来 bot 拿数据,今天发现它 refresh_token 始终用不了。

auth 的时候没问题,能顺利获取,但是拿到的 refresh_token 没法用来再刷新。

这账号已经没有继续续费了,于是改了一下密码,refresh_token 会被重置。但是重置之后问题还在。

python .\pixiv_auth.py login
code: wSGh2******HldvFQ
access_token: trivvWu******CJ5M
refresh_token: m******s1jlM
expires_in: 3600
python .\pixiv_auth.py refresh m******s1jlM
error:
{'error': 'invalid_grant',
 'errors': {'system': {'code': 1508, 'message': 'Invalid refresh token'}},
 'has_error': True}

尝试抓包手机客户端,抓包出来官方客户端确实用的一样的 refresh_token,然后过期之后点进去,好像官方客户端也报错直接退出登录态了(可惜大意了没抓到,复现可能要等一小时,故放弃)。

尝试使用 curl 模拟,也是 http 400

最后放弃了,新注册了个小号,倒是一点问题没有。

@upbit upbit added the question label Feb 8, 2025
@upbit
Copy link
Owner

upbit commented Feb 8, 2025

我遇到过,号被封禁了。我那个号登录一个提醒,告知频率过高:

Image

推测是对调用API的数量有监控,超过App正常范围会被ban。换个号可以解决

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants