#8259 网络连接失败Traceback (most recent call last):

23.177**3 Posted at: 3 hours ago

网络连接失败
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 "videotrans\task\_only_one.py", line 86, in run
File "videotrans\task\trans_create.py", line 716, in dubbing
File "videotrans\task\trans_create.py", line 1028, in _tts
File "videotrans\tts\__init__.py", line 336, in run
File "videotrans\tts\_base.py", line 193, in run
File "videotrans\tts\_edgetts.py", line 66, 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 573, in stream
File "edge_tts\communicate.py", line 431, in __stream
File "aiohttp\client.py", line 1482, in aenter
File "aiohttp\client.py", line 1078, in _ws_connect
aiohttp.client_exceptions.WSServerHandshakeError: 403, message='Invalid response status', url='wss://speech.platform.bing.com/consumer/speech/synthesize/readaloud/edge/v1?TrustedClientToken=6A5AA1D4EAFF4E9FB37E23D68491D6F4&ConnectionId=139a0771dc0e4877b21022e8bc48674a&Sec-MS-GEC=84DB96E93DC8FB651C4F58511653275D753D86DE4AE2EF703FDBD8680AD79D2F&Sec-MS-GEC-Version=1-143.0.3650.75'


=
system:Windows-10-10.0.19045-SP0
version:v3.99
frozen:True
language:zh
root_dir:E:/BaiduNetdiskDownload/ruanjian

1 Replies

#1 DeepSeek reply at 3 hours ago

核心原因:微软已更改 Edge-TTS 免费接口的验证逻辑(Sec-MS-GEC 令牌校验),旧版本 v3.99 内置的 edge-tts 库已失效,因此连接被服务端以 403 Invalid response status 拒绝。这属于版本兼容问题,与你的网络、密钥无关。

解决方案:

  1. 升级到 v4.16(根本解决办法)

    • 你的版本是 v3.99(frozen 预打包版),跨度较大,请下载 2.7GB 的完整包(不要只下 260MB 补丁包)覆盖安装:https://pyvideotrans.com/downpackage
    • 解压到纯英文路径(如 D:\pyVideoTrans),不要覆盖在含中文的目录下。
    • v4.16 已专门修复 Edge-TTS 403 问题。
  2. 若暂时无法升级,可做临时缓解(不保证有效)

    • 打开 菜单 → 工具 → 高级选项 → 字幕配音调整,将 EdgeTTS配音渠道配音并发数 设为 1,配音后暂停秒 设为 5~10。
    • 在软件根目录(sp.exe 所在文件夹)新建一个空文本文件,命名为 edgetts-noproxy.txt,强制 Edge-TTS 不走代理,排除代理握手干扰。
  3. 替代方案(升级前应急)

    • 配音渠道改用 gTTS(免费)(国内需科学上网),或本地内置渠道如 Piper/VITS,先把任务跑通。

请查阅相关文档:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
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.

Dondate via ko-fi.com

Related resource