Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

参考 #13 不能用 #23

Open
cdlhao opened this issue Feb 15, 2023 · 3 comments
Open

参考 #13 不能用 #23

cdlhao opened this issue Feb 15, 2023 · 3 comments

Comments

@cdlhao
Copy link

cdlhao commented Feb 15, 2023

直接外网测试
http 代理:Translate(proxies={"https": "http://localhost:10809"})
socks5 代理: Translate(proxies={"https": "socks5://localhost:10808"})
两个都不能用
错误如下
Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。')))
代码没问题 之前用过突然不能用。
ApiKeyTranslate 有没有范例代码?

@lemisky
Copy link
Member

lemisky commented Feb 15, 2023

应该是代理的问题

@lemisky
Copy link
Member

lemisky commented Feb 15, 2023

from pygtrans import ApiKeyTranslate

at = ApiKeyTranslate('<app_id>')
text = at.translate('hello)
print(text)

@cdlhao
Copy link
Author

cdlhao commented Feb 15, 2023

谢谢 申请个apikey去 代理太头疼了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants