urllib3 proxy error
katresars opened this issue · 4 comments
katresars commented
code example:
api = AppPixivAPI()
api.requests.proxies = self.proxies
print(api.requests.proxies)
# api = ByPassSniApi()
# api.require_appapi_hosts(hostname="app-api.secure.pixiv.net",timeout=3)
token_file = Path('./refresh-token.txt')
with token_file.open('rt') as f:
refresh_token = f.read().strip()
# self.api.set_cloudscrape_proxy()
api.auth(refresh_token = refresh_token)
# 刷新auth token
with token_file.open('wt') as f:
print(api.refresh_token, file = f)
print('Auth Finished...')
return api
error message:
urllib3.exceptions.ProxyError: ('Unable to connect to proxy', SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)')))
requests.exceptions.ProxyError: HTTPSConnectionPool(host='oauth.secure.pixiv.net', port=443): Max retries exceeded with url: /auth/token (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))))
结果为更新pixiv库时pip更新的urllib3版本问题导致的代理问题 降级urllib3代理恢复正常
一万个小问号???
upbit commented
因为最新requests的依赖,urllib3做了个大版本更新。可能有些情况不能完全覆盖
方便提供下你的Python版本、系统环境和requests库的版本信息吗?
upbit commented
@katresars 可以提供更多的环境相关信息,用来定位这个兼容性问题吗?
katresars commented
之前使用的是降级的urllib,遇到错误后直接更新requests库,现在一切正常
upbit commented
升级requests后正常,那先关闭这个issue。如果遇到可以提供信息并重新打开