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 316 forks source link

Server returned a status code of 403 while downloading bot list #232

Closed Gsingh225 closed 1 year ago

Gsingh225 commented 1 year ago

Looking into how the api works, I discovered that the bot attempts to download a list of bots, but the server responds with a 403.

Heres the exact error message """/usr/local/bin/python3 /Users/gurpret/artist/testa pi.py 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 "/Users/g/artist/testapi.py", line 8, in client = poe.Client('TOKEN REMOVED') File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/poe/init.py", line 156, in init self.connect_ws() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/poe/init.py", line 446, in connect_ws self.setup_connection() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/poe/init.py", line 182, in setup_connection self.next_data = self.get_next_data(overwrite_vars=True) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/poe/init.py", line 244, in get_next_data r = request_with_retries(self.session.get, self.home_url) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/poe/init.py", line 84, in request_with_retries raise RuntimeError(f"Failed to download {url} too many times.") RuntimeError: Failed to download https://poe.com too many times."""

The code I was running was """

import poe import json import logging import time

poe.logger.setLevel(logging.INFO) client = poe.Client('TOKEN HIDDEN')

client.get_bot_by_codename("Midjourney")

def callback(suggestion): print("Suggested reply:", suggestion)

message = "Summarize the GNU GPL v3" for chunk in client.send_message("capybara", message, with_chat_break=True, suggest_callback=callback): print(chunk["text_new"], end="", flush=True) print()

Suggested replies usually come in a few seconds after the message is fully received

time.sleep(5)

""" basically just the example code, as this was my first time trying the api. And yes, I did use my actual token, just removed here.

meshaalhaji commented 1 year ago

I really wish this issue is resolved.

ading2210 commented 1 year ago

This library currently does not work. See #231 for more information.