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

pixiv rank Rate Limit? #397

Closed
pppaapp opened this issue Oct 30, 2023 · 3 comments
Closed

pixiv rank Rate Limit? #397

pppaapp opened this issue Oct 30, 2023 · 3 comments
Labels
question Further information is requested

Comments

@pppaapp
Copy link

pppaapp commented Oct 30, 2023

CleanShot 2023-10-30 at 20 24 13@2x

What is this?

@pppaapp
Copy link
Author

pppaapp commented Oct 30, 2023

Now I get this error...

CleanShot 2023-10-30 at 22 13 38@2x

@8852690
Copy link

8852690 commented Feb 14, 2024

I often encounter this problem too.
我也经常遇到这个问题。
This problem seems to be caused by the user logging in elsewhere/the current token becoming invalid.
这个问题似乎是因为 用户在其他地方登录/当前令牌失效导致的。
You can try logging in again to obtain the token to solve the problem?
你可以尝试重新登录获取令牌来解决问题?
If possible, you can try to add an automatic refresh token operation to the code.
如果可能的话,你可以尝试在代码中增加自动刷新令牌的操作。

@mnixry
Copy link
Member

mnixry commented Feb 14, 2024

Rate limiting is Pixiv first-party is limiting your API requests to their server.

You can configure multiple accounts to make load balance if there does have a large amount request. In this case, you may need preventing your instance from frequently restarting or using external caching (e.g. DiskCache or Redis) instead of in memory caching. For more information about caching, see #114 and #380.

I don't know if there is an IP-addresses based rate limit or something similar has been applied recently. It is completely black box for us. Increase caching size or adding more account to load-balancing (see comments in config file) request may help.

This problem seems to be caused by the user logging in elsewhere/the current token becoming invalid.

I haven't touched code for a time, but I remember there should be another error if the token became invalid.

If possible, you can try to add an automatic refresh token operation to the code.

There does have a token refreshing operation. Access Token will be refreshed after it expires (lazy refreshing, i.e. check if expired locally at each request and does refresh if it expired), by Refresh Token.

Refresh Token, however, should last more than one year if there are no manually logout operation, so that does not require frequently rotate. (and it can't be rotated automatically since there are a few captchas / firewalls existed).

@mnixry mnixry added the question Further information is requested label Feb 14, 2024
@pppaapp pppaapp closed this as completed Jun 10, 2024
@mnixry mnixry pinned this issue Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Development

No branches or pull requests

3 participants