snowby666 / poe-api-wrapper

👾 A Python API wrapper for Poe.com. With this, you will have free access to GPT-4, Claude, Llama, Gemini, Mistral and more! 🚀
https://pypi.org/project/poe-api-wrapper/
GNU General Public License v3.0
687 stars 82 forks source link

Failed to extract the form key #86

Closed krishna2206 closed 7 months ago

krishna2206 commented 7 months ago

The library is currently broken, failed to extract the formkey (they changed the HTML) :

...... File "/home/krishna/.local/lib/python3.10/site-packages/poe.py", line 150, in __init__ self.connect_ws() File "/home/krishna/.local/lib/python3.10/site-packages/poe.py", line 412, in connect_ws self.setup_connection() File "/home/krishna/.local/lib/python3.10/site-packages/poe.py", line 176, in setup_connection self.next_data = self.get_next_data(overwrite_vars=True) File "/home/krishna/.local/lib/python3.10/site-packages/poe.py", line 225, in get_next_data self.formkey = self.extract_formkey(r.text) File "/home/krishna/.local/lib/python3.10/site-packages/poe.py", line 202, in extract_formkey script_text = re.search(script_regex, html).group(1) AttributeError: 'NoneType' object has no attribute 'group'

Vadim-Khristenko commented 7 months ago

Hello! I don’t know exactly what your error is, but the library is working with my Telegram bot right now.

Additionally: This may be because the code runs through a Server in the Netherlands, but the Library works.

Vadim-Khristenko commented 7 months ago
INFO:httpx:HTTP Request: POST https://www.quora.com/poe_api/gql_POST "HTTP/1.1 200 OK"
INFO:aiogram.event:Update id=670325089 is handled. Duration 11546 ms by bot id=6754706784
INFO:httpx:HTTP Request: POST https://www.quora.com/poe_api/receive_POST "HTTP/1.1 200 OK"

Here you can see that the answers come calmly and without problems, maybe your Libraries are conflicting or something else. Try to remove and reinstall the library and see if your code works, if not, come here, I will give you my code that works now.

krishna2206 commented 7 months ago

yeah, there was a conflict with another library, my bad thank you