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

SSLError #19

Open
Hammour-steak opened this issue Apr 6, 2023 · 6 comments
Open

SSLError #19

Hammour-steak opened this issue Apr 6, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@Hammour-steak
Copy link

Hammour-steak commented Apr 6, 2023

I would like to ask that I have obtained the token now, but an error occurred while running the example:
running code:

import poe
import logging
import sys

#send a message and immediately delete it

client = poe.Client("my token")

message = "Who are you?"
for chunk in client.send_message("capybara", message, with_chat_break=True):
  print(chunk["text_new"], end="", flush=True)

#delete the 3 latest messages, including the chat break
client.purge_conversation("capybara", count=3)

exception:
Traceback (most recent call last):
File "C:/Users/hammour/Desktop/poe-api-main/examples/temporary_message.py", line 7, in
client = poe.Client("my token", proxy="socks5://127.0.0.1:7890")
File "C:\Users\hammour\Desktop\poe-api-main\poe-api\src\poe.py", line 73, in init
self.next_data = self.get_next_data()
File "C:\Users\hammour\Desktop\poe-api-main\poe-api\src\poe.py", line 89, in get_next_data
r = request_with_retries(self.session.get, self.home_url)
File "C:\Users\hammour\Desktop\poe-api-main\poe-api\src\poe.py", line 32, in request_with_retries
r = method(*args, **kwargs)
File "D:\Anaconda\envs\cvstudy\lib\site-packages\requests\sessions.py", line 555, in get
return self.request('GET', url, **kwargs)
File "D:\Anaconda\envs\cvstudy\lib\site-packages\requests\sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "D:\Anaconda\envs\cvstudy\lib\site-packages\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "D:\Anaconda\envs\cvstudy\lib\site-packages\requests\adapters.py", line 510, in send
raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='poe.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', OSError(0, 'Error')))

It seems like this code is wrong:
client = poe.Client("my token")

@ading2210 ading2210 added the bug Something isn't working label Apr 6, 2023
@ading2210
Copy link
Owner

requests.exceptions.ProxyError: HTTPSConnectionPool(host='poe.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', OSError(0, 'Error')))

It seems that you're trying to connect with a proxy. Can you verify that your proxy works on poe.com and other sites?

@Hammour-steak
Copy link
Author

Yes, it works well on poe, google or youtube

@Hammour-steak
Copy link
Author

and i try to add an argument in poe.Client:
proxy="socks5://127.0.0.1:7890"
it still broken.

@ading2210
Copy link
Owner

Maybe try the socks5h protocol, which also proxies the DNS queries? Also, are you able to use the same proxy with the python requests module in a different script?

@Mr-Cong
Copy link

Mr-Cong commented Apr 20, 2023

I meet the same problem.I tried pip install urllib3==1.25.11 and the problem is resovled.

@def-saizi-baka
Copy link

I would like to ask that I have obtained the token now, but an error occurred while running the example: running code:

import poe
import logging
import sys

#send a message and immediately delete it

client = poe.Client("my token")

message = "Who are you?"
for chunk in client.send_message("capybara", message, with_chat_break=True):
  print(chunk["text_new"], end="", flush=True)

#delete the 3 latest messages, including the chat break
client.purge_conversation("capybara", count=3)

exception: Traceback (most recent call last): File "C:/Users/hammour/Desktop/poe-api-main/examples/temporary_message.py", line 7, in client = poe.Client("my token", proxy="socks5://127.0.0.1:7890") File "C:\Users\hammour\Desktop\poe-api-main\poe-api\src\poe.py", line 73, in init self.next_data = self.get_next_data() File "C:\Users\hammour\Desktop\poe-api-main\poe-api\src\poe.py", line 89, in get_next_data r = request_with_retries(self.session.get, self.home_url) File "C:\Users\hammour\Desktop\poe-api-main\poe-api\src\poe.py", line 32, in request_with_retries r = method(*args, **kwargs) File "D:\Anaconda\envs\cvstudy\lib\site-packages\requests\sessions.py", line 555, in get return self.request('GET', url, **kwargs) File "D:\Anaconda\envs\cvstudy\lib\site-packages\requests\sessions.py", line 542, in request resp = self.send(prep, **send_kwargs) File "D:\Anaconda\envs\cvstudy\lib\site-packages\requests\sessions.py", line 655, in send r = adapter.send(request, **kwargs) File "D:\Anaconda\envs\cvstudy\lib\site-packages\requests\adapters.py", line 510, in send raise ProxyError(e, request=request) requests.exceptions.ProxyError: HTTPSConnectionPool(host='poe.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', OSError(0, 'Error')))

It seems like this code is wrong: client = poe.Client("my token")

Try http://127.0.0.1:7890 ?

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

No branches or pull requests

4 participants