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

Server returned a status code of 400 while downloading https://poe.com/api/gql_POST #230

Open
ading2210 opened this issue Aug 19, 2023 · 8 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@ading2210
Copy link
Owner

(.venv) allen@dedipath-instance-1:~/projects/poe-api$ python3 examples/temporary_message.py "xxxxxxxxxxxxxxxxxxxx%3D%3D"
INFO:root:Setting up session...
INFO:root:Downloading next_data...
INFO:httpx:HTTP Request: GET https://poe.com "HTTP/1.1 200 OK"
INFO:httpx:HTTP Request: GET https://psc2.cf2.poecdn.net/7f2217bbcdbfed56b253b36c7dba078a36090fad/_next/static/chunks/pages/_app-e27ceba2530b4b53.js "HTTP/1.1 200 OK"
INFO:root:Downloading channel data...
INFO:httpx:HTTP Request: GET https://poe.com/api/settings "HTTP/1.1 200 OK"
INFO:root:Downloading all bots...
INFO:httpx:HTTP Request: POST https://poe.com/api/gql_POST "HTTP/1.1 400 Bad Request"
WARNING:root:Server returned a status code of 400 while downloading https://poe.com/api/gql_POST. Retrying (1/10)...
INFO:httpx:HTTP Request: POST https://poe.com/api/gql_POST "HTTP/1.1 400 Bad Request"
WARNING:root:Server returned a status code of 400 while downloading https://poe.com/api/gql_POST. Retrying (2/10)...
INFO:httpx:HTTP Request: POST https://poe.com/api/gql_POST "HTTP/1.1 400 Bad Request"
WARNING:root:Server returned a status code of 400 while downloading https://poe.com/api/gql_POST. Retrying (3/10)...
INFO:httpx:HTTP Request: POST https://poe.com/api/gql_POST "HTTP/1.1 400 Bad Request"
WARNING:root:Server returned a status code of 400 while downloading https://poe.com/api/gql_POST. Retrying (4/10)...
INFO:httpx:HTTP Request: POST https://poe.com/api/gql_POST "HTTP/1.1 400 Bad Request"
WARNING:root:Server returned a status code of 400 while downloading https://poe.com/api/gql_POST. Retrying (5/10)...
INFO:httpx:HTTP Request: POST https://poe.com/api/gql_POST "HTTP/1.1 400 Bad Request"
WARNING:root:Server returned a status code of 400 while downloading https://poe.com/api/gql_POST. Retrying (6/10)...
INFO:httpx:HTTP Request: POST https://poe.com/api/gql_POST "HTTP/1.1 400 Bad Request"
WARNING:root:Server returned a status code of 400 while downloading https://poe.com/api/gql_POST. Retrying (7/10)...
INFO:httpx:HTTP Request: POST https://poe.com/api/gql_POST "HTTP/1.1 400 Bad Request"
WARNING:root:Server returned a status code of 400 while downloading https://poe.com/api/gql_POST. Retrying (8/10)...
INFO:httpx:HTTP Request: POST https://poe.com/api/gql_POST "HTTP/1.1 400 Bad Request"
WARNING:root:Server returned a status code of 400 while downloading https://poe.com/api/gql_POST. Retrying (9/10)...
INFO:httpx:HTTP Request: POST https://poe.com/api/gql_POST "HTTP/1.1 400 Bad Request"
WARNING:root:Server returned a status code of 400 while downloading https://poe.com/api/gql_POST. Retrying (10/10)...
Traceback (most recent call last):
  File "/home/allen/projects/poe-api/examples/temporary_message.py", line 9, in <module>
    client = poe.Client(token)
             ^^^^^^^^^^^^^^^^^
  File "/home/allen/projects/poe-api/src/poe/__init__.py", line 155, in __init__
    self.connect_ws()
  File "/home/allen/projects/poe-api/src/poe/__init__.py", line 448, in connect_ws
    self.setup_connection()
  File "/home/allen/projects/poe-api/src/poe/__init__.py", line 196, in setup_connection
    self.bots = self.get_bots(download_next_data=False)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/allen/projects/poe-api/src/poe/__init__.py", line 282, in get_bots
    bot_list_data = self.send_query("BotSwitcherModalQuery", {})["data"]["viewer"]["availableBotsConnection"]
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/allen/projects/poe-api/src/poe/__init__.py", line 391, in send_query
    r = request_with_retries(self.session.post, self.gql_url, data=payload, headers=headers)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/allen/projects/poe-api/src/poe/__init__.py", line 83, in request_with_retries
    raise RuntimeError(f"Failed to download {url} too many times.")

#227 was fixed, although a new issue comes up.

@ading2210 ading2210 added bug Something isn't working help wanted Extra attention is needed labels Aug 19, 2023
@ghost-in-a-shell
Copy link

Maybe poe has changed the headers and payload format yesterday.

@MujtabaMohsin
Copy link

This project is not working anymore.

@AhmedWaleed45
Copy link

Same here but I had this error even before the update

@Nox998464
Copy link

Nox998464 commented Aug 20, 2023

I think poe is blocking requests sent to https://poe.com/api/gql_POST. May be we can make a workaround through https://www.quora.com/poe_api/gql_POST ?
I found this one helpful with that implement: https://github.com/snowby666/poe-api-wrapper

@AhmedWaleed45
Copy link

@Nox998464 So did the wrapper work with you or not?

@Nox998464
Copy link

Nox998464 commented Aug 20, 2023

@Nox998464 So did the wrapper work with you or not?

Yeh, the wrapper runs smoothly for me. But Im still waiting for the async update of it

@AhmedWaleed45
Copy link

AhmedWaleed45 commented Aug 20, 2023

@Nox998464 So did the wrapper work with you or not?

Yeh, the wrapper runs smoothly for me. But Im still waiting for the async update of it

great thanks for the advice I will try

@ading2210 ading2210 pinned this issue Aug 20, 2023
@win4r
Copy link

win4r commented Sep 1, 2023

最新AI集成软件-AI超元域:https://github.com/win4r/AISuperDomain

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

No branches or pull requests

6 participants