#8392 Network connection failed:{'text': 'Hello, my dear friend, I hope every day of yours is wonderful and joyful!', 'rate':

2409**d914 Posted at: 1 hour ago

Network connection failed:
{'text': 'Hello, my dear friend, I hope every day of yours is wonderful and joyful!', 'rate': '+0%', 'role': 'Eric(Male/US)', 'filename': 'C:\Users\15533\AppData\Local\Temp/pyvideotrans/0-1792739235.5627666.wav', 'tts_type': 0, 'language': 'en', 'volume': '+0%', 'pitch': '+0Hz'}
Traceback (most recent call last):
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 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=b94511b0b60a4f0a9e4e35a6df62086d&Sec-MS-GEC=3ECE9DDCDED00A14C42985CE7C1A61B063991DF146A4C09D4F421CC5A691FB5D&Sec-MS-GEC-Version=1-143.0.3650.75'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 21, in run
File "videotrans\tts\__init__.py", line 119, in run
File "videotrans\tts\_base.py", line 93, in run
File "asyncio\runners.py", line 44, in run
File "asyncio\base_events.py", line 649, in run_until_complete
File "videotrans\tts\_edgetts.py", line 154, in _exec
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=41a13d4cd308449db96deed68883cadf&Sec-MS-GEC=3ECE9DDCDED00A14C42985CE7C1A61B063991DF146A4C09D4F421CC5A691FB5D&Sec-MS-GEC-Version=1-143.0.3650.75'


=
system:Windows-10-10.0.22631-SP0
version:v4.14
frozen:True
language:zh_CN
root_dir:D:/Softwore/pyVideotrans/win-pyvideotrans-v4.14

1 Replies

#1 DeepSeek reply at 1 hour ago

这个报错不是你的音频文件或文本内容有问题,而是 Edge TTS 连接微软服务器时被拒绝:HTTP 403 / WSServerHandshakeError。edge-tts 是调用微软 Edge 朗读的免费接口,服务器端会做风控、令牌校验和限流,所以容易出现 403。

最可能原因

  1. Edge TTS 接口风控/限流:当前 IP、代理、节点、请求频率被微软拒绝。
  2. edge-tts 版本与当前微软接口不兼容:尤其是 Sec-MS-GEC 令牌校验变化。
  3. 系统时间不准:令牌与时间相关,偏差过大也会 403。
  4. 代理/VPN 问题:代理未配置、节点被风控、TLS 被拦截。
  5. pyVideotrans v4.14 内置组件较旧,免费 Edge TTS 接口本身不稳定。

建议按顺序处理

  1. 先降低频率/重试
    暂停批量任务,等 10~30 分钟;单条重试。若批量任务并发高,改为低并发。
  2. 同步 Windows 时间
    设置 → 时间和语言 → 日期和时间 → 立即同步。
    管理员 PowerShell 可执行:

    w32tm /resync
  3. 检查网络/代理
    如果你开了 VPN、Clash、系统代理:

    • 在 pyVideotrans 设置里填写正确的 HTTP/SOCKS 代理;或
    • 关闭代理换直连;或
    • 换一个节点/手机热点测试。
      不要使用会拦截 HTTPS/WSS 证书的代理。

    测试连通性:

    Test-NetConnection speech.platform.bing.com -Port 443

    能通不代表 WebSocket 一定可用,但完全不通就是网络问题。

  4. 更新 pyVideotrans
    v4.14 如果是旧打包版,建议到官网/GitHub 下载最新版完整包,不要只替换 exe。免费 Edge TTS 接口变动频繁,作者通常会更新依赖修复。
  5. 清理临时文件后重试
    可清理:

    C:\Users\15533\AppData\Local\Temp\pyvideotrans

    然后重启软件再试。

  6. 如果仍 403,改用其他 TTS 引擎
    Edge TTS 是免费非官方接口,403 可能持续一段时间。建议临时切换到:

    • Azure 语音合成(官方 Key,最稳定)
    • Google TTS
    • 本地 TTS / 其他语音引擎
      不要一直卡在 Edge TTS 上。

结论

优先做这四件事:同步系统时间 → 换网络/代理节点 → 更新 pyVideotrans 到最新版 → 降低并发重试。
如果只有 Edge TTS 报 403,而其他联网功能正常,基本可以确定是微软 Edge 朗读接口风控或版本兼容问题,不是你的电脑或音频文件坏了。

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