ading2210 / poe-api

[UNMAINTAINED] A reverse engineered Python API wrapper for Quora's Poe, which provides free access to ChatGPT, GPT-4, and Claude.
https://pypi.org/project/poe-api
GNU General Public License v3.0
2.5k stars 315 forks source link

Server returned a status code of 403 while downloading https://poe. com #218

Closed Akut0 closed 1 year ago

Akut0 commented 1 year ago
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 "start_bot.py", line 4, in <module>
    from plugin_chatgpt import GPT
  File "C:\MM Bot\plugin_chatgpt.py", line 74, in <module>
    poe_client = poe.Client(poe_token)
  File "C:\Python390\lib\site-packages\poe\__init__.py", line 156, in __init__
    self.connect_ws()
  File "C:\Python390\lib\site-packages\poe\__init__.py", line 446, in connect_ws

    self.setup_connection()
  File "C:\Python390\lib\site-packages\poe\__init__.py", line 182, in setup_conn
ection
    self.next_data = self.get_next_data(overwrite_vars=True)
  File "C:\Python390\lib\site-packages\poe\__init__.py", line 244, in get_next_d
ata
    r = request_with_retries(self.session.get, self.home_url)
  File "C:\Python390\lib\site-packages\poe\__init__.py", line 84, in request_wit
h_retries
    raise RuntimeError(f"Failed to download {url} too many times.")
RuntimeError: Failed to download https://poe.com too many times.
ading2210 commented 1 year ago

not the same promblem, i can successfuly download the poe.com, but i can't send query successfullt. @canxin121

Are you able to port those changes from your async client to this library?

canxin121 commented 1 year ago

not the same promblem, i can successfuly download the poe.com, but i can't send query successfullt. @canxin121

Are you able to port those changes from your async client to this library?

But my library don't have this downloading problem. I don't know why, perhaps because the headers? or aiohttp?I will try to find the reason.

johnd0e commented 1 year ago

https://github.com/x404xx/POE-Api seems ok

GoAwayNow commented 1 year ago

@ongspxm I got a 200 returned with a full set of browser cookies and the user-agent. I didn't use the authority header and made the request with http1.1. I don't know if it's the same for everyone, but it seems to be entirely a Cloudflare issue for me.

tic-top commented 1 year ago

寄!

Iamprashanth-1 commented 1 year ago

try g4f pypi

Nox998464 commented 1 year ago

https://github.com/snowby666/poe-api-wrapper is working for me

ading2210 commented 1 year ago

I've fixed this in the latest commit, but the library is still broken due to changes in the __NEXT_DATA__ format.

DogManTC commented 1 year ago

I've fixed this in the latest commit, but the library is still broken due to changes in the __NEXT_DATA__ format.

So does it work now or not?