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

RuntimeError: Rate limit exceeded for sending requests to poe.com due to Cloudflare protection? #192

Open
ljt0640p opened this issue Sep 21, 2024 · 1 comment

Comments

@ljt0640p
Copy link

Hi developer,

Sorry for raising a similar issue again about the Rate limit. Previous closed issues can't solve my problem, so I open a new one.

The problem is when I'm testing the base usage code as following:,

tokens = {
    'p-b': 'xxx',
    'p-lat': 'xxx',
    'formkey': 'xxx',
    '__cf_bm': 'xxx',
    'cf_clearance': 'xxx'}

from poe_api_wrapper import PoeApi
client = PoeApi(tokens=tokens)

I'm quite sure the token parameters are filled correctly following the instructions in the documentation.

After execution, I got the following error:

2024-09-21 13:16:05.227 | ERROR | poe_api_wrapper.api:connect_ws:235 - Failed to get channel settings. Reason: unexpected character: line 1 column 1 (char 0)
2024-09-21 13:16:06.255 | ERROR | poe_api_wrapper.api:connect_ws:235 - Failed to get channel settings. Reason: unexpected character: line 1 column 1 (char 0)

After tracing the code, the error seems to come from this line :
response_json = orjson.loads(self.client.get(f'{self.BASE_URL}/api/settings', headers=self.HEADERS, follow_redirects=True, timeout=30).text) in the function "get_channel_settings()" in poe_api_wrapper/api.py

When I printed out the content "self.client.get(f'{self.BASE_URL}/api/settings', headers=self.HEADERS, follow_redirects=True, timeout=30).text", it's a HTML page with title "Just a moment..." and some Cloudflare-relevant parameters.

It seems to me the issue actually comes from the Cloudflare protection, which I can't go through.

Is there any suggestion for this issue?

Many thanks,
YK

@wchan757
Copy link

@ljt0640p

Hey mate, I encountered an issue, and it seems possible that the p-b and p-lat change.

I also found that if I have another POE account logged in on the browser, it happens. What I do is just log out and use the target one.

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

No branches or pull requests

2 participants