#933 aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host api.msedgeservices.com:443 ssl:<ssl.SSLContext ob

2409:8a34* Posted at: 1 day ago 👁9

系统错误 (10054):远程主机强迫关闭了一个现有的连接。:

Traceback (most recent call last):

File "videotrans\tts\_base.py", line 128, in run

RuntimeError: no running event loop

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "aiohttp\connector.py", line 1263, in _wrap_create_connection

File "asyncio\base_events.py", line 1089, in create_connection

File "asyncio\base_events.py", line 1119, in _create_connection_transport

File "asyncio\selector_events.py", line 853, in _read_ready__data_received

ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。

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

Traceback (most recent call last):

File "videotrans\util\ListenVoice.py", line 18, in run

File "videotrans\tts\__init__.py", line 248, in run

File "videotrans\tts\_base.py", line 182, in run

File "videotrans\tts\_edgetts.py", line 70, in _create_audio_with_retry

File "asyncio\tasks.py", line 445, in wait_for

File "edge_tts\communicate.py", line 590, in save

File "edge_tts\communicate.py", line 566, in stream

File "edge_tts\communicate.py", line 431, in __stream

File "aiohttp\client.py", line 1482, in __aenter__

File "aiohttp\client.py", line 1061, in _ws_connect

File "aiohttp\client.py", line 770, in _request

File "aiohttp\client.py", line 725, in _connect_and_send_request

File "aiohttp\connector.py", line 622, in connect

File "aiohttp\connector.py", line 1189, in _create_connection

File "aiohttp\connector.py", line 1561, in _create_direct_connection

File "aiohttp\connector.py", line 1530, in _create_direct_connection

File "aiohttp\connector.py", line 1271, in _wrap_create_connection

aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host api.msedgeservices.com:443 ssl: [远程主机强迫关闭了一个现有的连接。]

=====

Windows-10-10.0.19045-SP0

version:v3.81

frozen:True

language:zh

3 Replies

本条内容由 DeepSeek 回复
根据您提供的错误日志,这是一个典型的网络连接问题,具体表现为在使用 Edge-TTS 配音渠道时,与微软服务器的连接被远程主机(微软服务器)强制中断(错误代码 10054)。这通常是由于网络不稳定、代理设置问题或服务器端临时限制导致的。

核心解决方案:调整配音设置以降低请求频率,并检查网络环境。

请按照以下步骤操作:

1. 降低 Edge-TTS 请求频率(首要步骤):

  • 打开软件,点击顶部菜单栏的 “工具/选项”
  • 选择 “高级选项”
  • 在弹出的设置窗口中,找到 “配音调整” 区域。
  • “同时配音字幕数” 的值修改为 1
  • “配音后暂停时间/秒” 的值修改为 5 或更高(例如 10)。
  • 点击 “确定” 保存设置。

2. 检查网络代理设置:

  • 如果您使用了网络代理(科学上网工具),请确保代理稳定且已正确设置。
  • 在软件的翻译或配音设置区域,检查 “网络代理” 文本框。如果填写了代理地址(如 http://127.0.0.1:10808),请确保该代理服务器正在运行且可以正常访问国际网络。您也可以尝试暂时取消代理设置,使用直连网络(如果您的网络环境允许直接访问微软服务)。

3. 稍后重试:

  • 有时错误是由于微软服务器端临时的流量限制或网络波动造成的。等待几分钟后,重新运行任务可能会成功。

4. (备选方案)更换配音渠道:

  • 如果以上方法均无效,您可以考虑暂时使用其他配音渠道,例如 OpenAI TTSAzure TTS(如果您有相应的 API 密钥),以完成当前任务。

完成上述设置调整后,请重新启动您的配音任务。如果问题依然存在,请提供您软件目录 videotrans/logs/ 下最新的日志文件,以便进行更深入的分析。

应该是触发了 Edge-TTS 的限流,应该如何避免

本条内容由 Gemini 回复
是的,您分析得很准确。Edge-TTS 频繁出现 ConnectionResetError403 错误,最常见的原因就是触发了微软服务器的限流策略。为了有效避免这种情况,您可以通过调整软件的配音参数来降低请求频率。

请按照以下步骤操作:

1. 打开高级选项

  • 在软件顶部菜单栏中,点击 工具/选项
  • 选择 高级选项

2. 调整配音参数

  • 在弹出的“高级选项”设置窗口中,找到 配音调整 区域(如下图所示)。
  • 同时配音字幕数 的值修改为 1。这表示软件将一次只处理一条字幕的配音请求。
  • 配音后暂停时间/秒 的值修改为 5 或更高(例如,您可以尝试 10 秒)。这会在每次完成一条字幕配音后,增加一个等待时间,进一步减少请求频率。

3. 保存并重试

  • 点击窗口底部的 确定 按钮保存您的设置。
  • 重新运行您的配音任务。

通过这些调整,您可以显著降低对 Edge-TTS API 的请求频率,从而减少被服务器限流的可能性。如果问题仍然偶尔出现,可以尝试进一步增加 配音后暂停时间/秒 的值。

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