点击查看 Edge-TTS 配音渠道无法使用的解决办法!!!

#1984 httpx.ConnectError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。

38.246* Posted at: 1 day ago 👁16

网络连接失败: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\http_proxy.py", line 317, in handle_request
File "httpcore\_sync\http11.py", line 383, in start_tls
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 "videotrans\util\TestSrtTrans.py", line 19, in run
File "videotrans\translator\__init__.py", line 932, in run
File "videotrans\translator\_base.py", line 78, in run
File "videotrans\translator\_base.py", line 137, in _run_srt
File "tenacity\__init__.py", line 338, in wrapped_f
File "tenacity\__init__.py", line 477, in call
File "tenacity\__init__.py", line 378, in iter
File "tenacity\__init__.py", line 400, in
File "concurrent\futures\_base.py", line 439, in result
File "concurrent\futures\_base.py", line 391, in __get_result
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_gemini.py", line 111, in _item_task
File "google\genai\models.py", line 5783, in generate_content_stream
File "google\genai\models.py", line 4666, in _generate_content_stream
File "google\genai\_api_client.py", line 774, in request_streamed
File "google\genai\_api_client.py", line 671, 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] 远程主机强迫关闭了一个现有的连接。


=
system:Windows-10-10.0.26100-SP0
version:v3.87
frozen:True
language:zh
root_dir:E:/ruanjian/win-pyvideotrans-v3.87

1 Replies

此错误是网络连接问题,具体是远程主机(很可能是 Google Gemini API 服务器)主动关闭了连接。这通常由网络不稳定、代理设置不当或 API 请求频率过高导致。

请按以下步骤排查:

  1. 检查网络代理:如果您使用了代理(VPN/Clash等),请确保代理稳定且能正常访问 https://generativelanguage.googleapis.com。在软件主界面第5行的“网络代理”处,填写正确的代理地址(如 http://127.0.0.1:7890),格式必须正确。
  2. 降低请求频率

    • 进入菜单 工具 -> 高级选项
    • 在“字幕翻译调整”区域,将“同时翻译字幕数”改为较小的值(例如 12)。
    • 将“翻译后暂停时间/秒”适当调高(例如 35)。
  3. 检查 API 密钥:确认您在“翻译设置”中为 Gemini 填写的 API 密钥有效且未过期。
  4. 尝试其他翻译渠道:如果问题持续,可以暂时切换到其他翻译渠道(如 DeepSeek、Google 翻译等)以完成当前任务。

如果以上步骤均无效,请提供 E:/ruanjian/win-pyvideotrans-v3.87/logs/ 目录下最新的日志文件,以便进一步分析。

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.

Donate: https://ko-fi.com/jianchang512

Trending Questions