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

测试翻译引擎出错, [WinError 10061] 由于目标计算机积极拒绝,无法连接。 #129

Closed
acid122 opened this issue Sep 19, 2023 · 16 comments
Labels
bug Something isn't working

Comments

@acid122
Copy link

acid122 commented Sep 19, 2023

calibre 版本号:6.26
ebook translator版本号:v2.1.4

点击"引擎"tab页后,使用google free或者chatgpt方式后,网络有开启全局代理(也有尝试设置"通用"tab页中的开启http代理),但点击测试后,会出现如下错误堆栈:
Traceback (most recent call last):
File "calibre_plugins.ebook_translator.components.engine", line 66, in translate_text
File "calibre_plugins.ebook_translator.engines.chatgpt", line 89, in translate
File "calibre_plugins.ebook_translator.engines.base", line 181, in get_result
Exception: 无法解析返回的响应。原始数据:
Traceback (most recent call last):
File "calibre_plugins.ebook_translator.engines.base", line 171, in get_result
File "mechanize_mechanize.py", line 257, in open
File "mechanize_mechanize.py", line 287, in _mech_open
File "mechanize_opener.py", line 193, in open
File "mechanize_urllib2_fork.py", line 425, in _open
File "mechanize_urllib2_fork.py", line 414, in _call_chain
File "mechanize_urllib2_fork.py", line 1283, in https_open
File "mechanize_urllib2_fork.py", line 1240, in do_open
urllib.error.URLError: <urlopen error [WinError 10061] 由于目标计算机积极拒绝,无法连接。>

@EdisonWendy
Copy link

EdisonWendy commented Sep 19, 2023

calibre 版本号:6.26 ebook translator版本号:v2.1.4

点击"引擎"tab页后,使用google free或者chatgpt方式后,网络有开启全局代理(也有尝试设置"通用"tab页中的开启http代理),但点击测试后,会出现如下错误堆栈: Traceback (most recent call last): File "calibre_plugins.ebook_translator.components.engine", line 66, in translate_text File "calibre_plugins.ebook_translator.engines.chatgpt", line 89, in translate File "calibre_plugins.ebook_translator.engines.base", line 181, in get_result Exception: 无法解析返回的响应。原始数据: Traceback (most recent call last): File "calibre_plugins.ebook_translator.engines.base", line 171, in get_result File "mechanize_mechanize.py", line 257, in open File "mechanize_mechanize.py", line 287, in _mech_open File "mechanize_opener.py", line 193, in open File "mechanize_urllib2_fork.py", line 425, in _open File "mechanize_urllib2_fork.py", line 414, in _call_chain File "mechanize_urllib2_fork.py", line 1283, in https_open File "mechanize_urllib2_fork.py", line 1240, in do_open urllib.error.URLError: <urlopen error [WinError 10061] 由于目标计算机积极拒绝,无法连接。>

我也遇到了同样的的问题,配置了Google cloud CLI以后还是不行,已经开了全局,在Chrome中的划词翻译插件也能正常使用Google翻译源,不清楚,请问解决了吗?
Quicker_20230919_131235

@bookfere
Copy link
Owner

@acid122

从错误信息看是网络代理有问题,建议检查你填写的代理 IP 和端口是否正确,如果配置无误可以尝试更换代理试试看。如果代理开启了全局模式,你可以在 Calibre 的设置中点击“杂项”看看是否有如下所示信息:

calibre-proxy

@EdisonWendy

从你给出的错误信息看,你遇到的问题与题主遇到的情况不同,看起来是代理没有应用成功,你可以通过以上步骤查看 Calibre 是否应用了代理。另外,你的描述中提到了“配置 Google Cloud CLI”,你是在使用 Google 的付费翻译引擎吗?

@EdisonWendy
Copy link

EdisonWendy commented Sep 19, 2023

@acid122

从错误信息看是网络代理有问题,建议检查你填写的代理 IP 和端口是否正确,如果配置无误可以尝试更换代理试试看。如果代理开启了全局模式,你可以在 Calibre 的设置中点击“杂项”看看是否有如下所示信息:

calibre-proxy @EdisonWendy

从你给出的错误信息看,你遇到的问题与题主遇到的情况不同,看起来是代理没有应用成功,你可以通过以上步骤查看 Calibre 是否应用了代理。另外,你的描述中提到了“配置 Google Cloud CLI”,你是在使用 Google 的付费翻译引擎吗?

网络代理是在calibre里设置还是代理程序里面?我在calibre里面没有找到配置代理的入口
Quicker_20230919_133758

Quicker_20230919_134015

@bookfere
Copy link
Owner

@EdisonWendy

Calibre 没有设置代理的地方,它只会读取系统环境变量中的代理配置(比如你设置的全局代理)。插件提供了代理设置功能,开启后插件会优先使用这个代理。

从截图上看,你设置的全局代理是 http://127.0.0.1:21882,Calibre 和插件(未在插件中开启代理的情况下)都会使用这个代理。你需要确保它与代理软件上提供的 HTTP 代理的 IP 和端口是一致的,并且代理本身是可用的。

另外,如果你使用的代理是通过规则路由的,还需要确保翻译引擎的 API 在代理范围内。

@EdisonWendy
Copy link

确保翻译引擎的 API 在代理范围内

已经确保全局代理地址和端口是与代理软件上提供的 HTTP 代理的 IP 和端口是一致的,并且代理本身是可用的。但是测试翻译(Google free和basic都不行)还是和刚刚一样超时。另外,怎样确保翻译引擎的 API 在代理范围内呢?
屏幕截图(112)
Quicker_20230919_141522

@bookfere
Copy link
Owner

bookfere commented Sep 19, 2023

@EdisonWendy 你开启的是全局模式,应该是和规则没关系了。不过在你提供的截图上,我注意到有和代理相关的用户名和密码信息,你为 HTTP 代理设置用户名和密码了吗?

@EdisonWendy
Copy link

@EdisonWendy 你开启的是全局模式,应该是和规则没关系了。不过在你提供的截图上,我注意到有和代理相关的用户名和密码信息,你为 HTTP 代理设置用户名和密码了吗?

并没有,那个用户名和密码是我随意填的,只是为了让命令走完看看有没有提示连接问题。

@bookfere
Copy link
Owner

@EdisonWendy 有试过插件中的代理设置吗?我在 Windows 上测试,使用全局代理确实会超时,用插件中的代理设置没问题。

@EdisonWendy
Copy link

@EdisonWendy 有试过插件中的代理设置吗?我在 Windows 上测试,使用全局代理确实会超时,用插件中的代理设置没问题。

这个我之前也试过,在插件中设置代理测试成功,倒是转到Google翻译引擎那一个标签去测试就还是老问题显示超时,但是是秒显示,比没在插件里面开启代理的时候快
屏幕截图(113)
Quicker_20230919_155530

@bookfere
Copy link
Owner

@EdisonWendy 这个客户端的 HTTP 代理端口应该是 21882,更改后再试试看。

@EdisonWendy
Copy link

EdisonWendy commented Sep 19, 2023

@EdisonWendy 这个客户端的 HTTP 代理端口应该是 21882,更改后再试试看。

这一次的问题好像不一样了
Quicker_20230919_160756
试了几次以后又变成这样了[WinError 10061]
Quicker_20230919_161624

@EdisonWendy
Copy link

@EdisonWendy 这个客户端的 HTTP 代理端口应该是 21882,更改后再试试看。

这一次的问题好像不一样了 Quicker_20230919_160756 试了几次以后又变成这样了[WinError 10061] Quicker_20230919_161624

可以了,前面的代理设置没注意保存,重新设置了一下就好了,端口确实要是21882才行

@bookfere bookfere added the bug Something isn't working label Sep 19, 2023
@bookfere
Copy link
Owner

插件无法正常使用全局代理的问题已在提交 2474bcc 中修复。你可以下载测试下面这个版本:

ebook-translator-202309191723.zip

@EdisonWendy
Copy link

EdisonWendy commented Sep 19, 2023

插件无法正常使用全局代理的问题已在提交 2474bcc 中修复。你可以下载测试下面这个版本:

ebook-translator-202309191723.zip

谢谢,插件能覆盖安装吗?还是先卸载旧的插件再安装此版本?

@bookfere
Copy link
Owner

@EdisonWendy 可以覆盖安装,但是要注意需要重启 Calibre 才能生效。

@acid122
Copy link
Author

acid122 commented Sep 20, 2023

感谢各位,没想到回复如此积极,也有朋友遇到类似的问题,那我这边今天继续试了一下,确实是代理问题,通过在“通用”tab中设置代理后,可以读取到chat翻译的返回,google free同理,希望遇到问题的朋友可以参考,同时感谢作者提供如此好的插件,方便大家的外语学习!

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

No branches or pull requests

3 participants