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."""
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.
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.