Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Status code of 403 on https//poe.com once again (0.4.16) #193

Closed
ading2210 opened this issue Jul 24, 2023 · 4 comments
Closed

Status code of 403 on https//poe.com once again (0.4.16) #193

ading2210 opened this issue Jul 24, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@ading2210
Copy link
Owner

(.venv) allen@dedipath-instance-1:~/projects/poe-api$ python3 examples/use_3rd_party_bot.py "xxxxxxxxxxxxxxxx%3D%3D"
INFO:root:Setting up session...
INFO:root:Downloading next_data...
WARNING:root:Server returned a status code of 403 while downloading https://poe.com. Retrying (1/10)...
WARNING:root:Server returned a status code of 403 while downloading https://poe.com. Retrying (2/10)...
WARNING:root:Server returned a status code of 403 while downloading https://poe.com. Retrying (3/10)...
WARNING:root:Server returned a status code of 403 while downloading https://poe.com. Retrying (4/10)...
WARNING:root:Server returned a status code of 403 while downloading https://poe.com. Retrying (5/10)...
WARNING:root:Server returned a status code of 403 while downloading https://poe.com. Retrying (6/10)...
WARNING:root:Server returned a status code of 403 while downloading https://poe.com. Retrying (7/10)...
WARNING:root:Server returned a status code of 403 while downloading https://poe.com. Retrying (8/10)...
WARNING:root:Server returned a status code of 403 while downloading https://poe.com. Retrying (9/10)...
WARNING:root:Server returned a status code of 403 while downloading https://poe.com. Retrying (10/10)...
Traceback (most recent call last):
  File "/home/allen/projects/poe-api/examples/use_3rd_party_bot.py", line 9, in <module>
    client = poe.Client(token)
             ^^^^^^^^^^^^^^^^^
  File "/home/allen/projects/poe-api/poe-api/src/poe.py", line 154, in __init__
    self.connect_ws()
  File "/home/allen/projects/poe-api/poe-api/src/poe.py", line 425, in connect_ws
    self.setup_connection()
  File "/home/allen/projects/poe-api/poe-api/src/poe.py", line 180, in setup_connection
    self.next_data = self.get_next_data(overwrite_vars=True)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/allen/projects/poe-api/poe-api/src/poe.py", line 235, in get_next_data
    r = request_with_retries(self.session.get, self.home_url)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/allen/projects/poe-api/poe-api/src/poe.py", line 82, in request_with_retries
    raise RuntimeError(f"Failed to download {url} too many times.")
RuntimeError: Failed to download https://poe.com too many times.
(.venv) allen@dedipath-instance-1:~/projects/poe-api$ 
@ading2210 ading2210 added the bug Something isn't working label Jul 24, 2023
@ading2210 ading2210 changed the title Status code of 403 on https//poe.com once again (0.4.15) Status code of 403 on https//poe.com once again (0.4.16) Jul 24, 2023
@claell
Copy link

claell commented Jul 24, 2023

By the way (and I guess this is also true for the past issues), this is only a problem if one instantiates a new client. At least my running (very small!) instance (Python script with while loop) that is already instantiated still works for me and I can chat with it.

@ading2210
Copy link
Owner Author

This has been fixed in v0.4.17.

@ading2210
Copy link
Owner Author

I've also added an option to manually supply the formkey, which should allow the library to continue functioning in case the automatic formkey extraction gets patched again.

@Ay-Da
Copy link

Ay-Da commented Sep 3, 2023

I tried it with all versions, but it doesn't work. :(

INFO:root:Setting up session...
INFO:root:Downloading next_data...
WARNING:root:Server returned a status code of 403 while downloading https://poe.com. Retrying (1/10)...
WARNING:root:Server returned a status code of 403 while downloading https://poe.com. Retrying (2/10)...
WARNING:root:Server returned a status code of 403 while downloading https://poe.com. Retrying (3/10)...
WARNING:root:Server returned a status code of 403 while downloading https://poe.com. Retrying (4/10)...
WARNING:root:Server returned a status code of 403 while downloading https://poe.com. Retrying (5/10)...
WARNING:root:Server returned a status code of 403 while downloading https://poe.com. Retrying (6/10)...
WARNING:root:Server returned a status code of 403 while downloading https://poe.com. Retrying (7/10)...
WARNING:root:Server returned a status code of 403 while downloading https://poe.com. Retrying (8/10)...
WARNING:root:Server returned a status code of 403 while downloading https://poe.com. Retrying (9/10)...
WARNING:root:Server returned a status code of 403 while downloading https://poe.com. Retrying (10/10)...
Traceback (most recent call last):
File "C:\Users\user\Downloads\poe-api-main\poe-api-main\examples\temporary_message.py", line 9, in
client = poe.Client(token)
^^^^^^^^^^^^^^^^^
File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\poe.py", line 154, in init
self.connect_ws()
File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\poe.py", line 423, in connect_ws
self.setup_connection()
File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\poe.py", line 180, in setup_connection
self.next_data = self.get_next_data(overwrite_vars=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\poe.py", line 233, in get_next_data
r = request_with_retries(self.session.get, self.home_url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\poe.py", line 82, in request_with_retries
raise RuntimeError(f"Failed to download {url} too many times.")
RuntimeError: Failed to download https://poe.com too many times.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants