#4168 RuntimeError: Connection error.

43.206* Posted at: 1 hour ago 👁7

Connection error.
Traceback (most recent call last):
File "httpx\_transports\default.py", line 101, in map_httpcore_exceptions
File "httpx\_transports\default.py", line 250, in handle_request
File "httpcore\_sync\connection_pool.py", line 216, in handle_request
File "httpcore\_sync\connection_pool.py", line 196, in handle_request
File "httpcore\_sync\connection.py", line 99, in handle_request
File "httpcore\_sync\connection.py", line 76, in handle_request
File "httpcore\_sync\connection.py", line 154, in _connect
File "httpcore\_backends\sync.py", line 152, in start_tls
File "contextlib.py", line 153, in exit
File "httpcore\_exceptions.py", line 14, in map_exceptions
httpcore.ConnectError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "openai\_base_client.py", line 1005, in request
File "httpx\_client.py", line 914, in send
File "httpx\_client.py", line 942, in _send_handling_auth
File "httpx\_client.py", line 979, in _send_handling_redirects
File "httpx\_client.py", line 1014, in _send_single_request
File "httpx\_transports\default.py", line 249, in handle_request
File "contextlib.py", line 153, in exit
File "httpx\_transports\default.py", line 118, in map_httpcore_exceptions
httpx.ConnectError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "videotrans\translator\_huoshan.py", line 45, in _item_task
File "openai\resources\responses\responses.py", line 898, in create
File "openai\_base_client.py", line 1297, in post
File "openai\_base_client.py", line 1037, in request
openai.APIConnectionError: Connection error.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\task\_only_one.py", line 65, in run
File "videotrans\task\trans_create.py", line 658, in trans
File "videotrans\translator\__init__.py", line 973, in run
File "videotrans\translator\_base.py", line 97, in run
File "videotrans\translator\_base.py", line 161, in _run_srt
File "videotrans\translator\_huoshan.py", line 55, in _item_task
RuntimeError: Connection error.


=
system:Windows-10-10.0.19045-SP0
version:v3.99
frozen:True
language:zh
root_dir:F:/FanYi/win-pyvideotrans-v3.99

1 Replies

这是网络连接问题导致的翻译渠道请求失败。错误信息显示在使用“字节火山”翻译渠道时,远程主机强制关闭了连接。

解决方案:

  1. 检查网络代理:如果你在中国大陆地区,使用字节火山等国内服务通常无需代理。请检查主界面“网络代理地址”是否为空。如果填写了代理地址,请清空该字段。
  2. 降低请求频率:在 菜单 -> 工具/选项 -> 高级选项 -> 字幕翻译调整 中,将“翻译后暂停秒”设置为一个较大的值(例如 5-10 秒),并将“AI翻译渠道每批字幕行数”适当减小(例如 10-20 行)。
  3. 确认API配置:检查 菜单 -> 翻译设置 -> 字节火山翻译 中的 API Key 和 Secret Key 是否正确且未过期。
  4. 切换翻译渠道:如果问题持续,可以暂时切换到其他翻译渠道(如 DeepSeek、Google翻译等)完成当前任务。
  5. 检查服务状态:确认字节火山方舟的翻译服务是否正常运行,或是否有地域访问限制。

请查阅相关文档:

Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Related resource