#5819 翻译字幕阶段出错 [Google(免费)] 429 Client Error: Too Many Requests for url: https://api-edge.cognitive.microsofttranslator.com/tr

2409:8a55* Posted at: 7 hours ago

翻译字幕阶段出错 [Google(免费)] 429 Client Error: Too Many Requests for url: https://api-edge.cognitive.microsofttranslator.com/translate?from=&to=fr&api-version=3.0&includeSentenceLength=true
Traceback (most recent call last):

File "videotrans\translator\_base.py", line 66, in run

File "videotrans\translator\_base.py", line 96, in _run_text

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 421, in exc_check

tenacity.RetryError: RetryError[]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "videotrans\task\job.py", line 35, in run

File "videotrans\task\job.py", line 135, in process_task

File "videotrans\task\translate_srt.py", line 47, in trans

File "videotrans\translator\_runner.py", line 63, in run

File "videotrans\translator\_base.py", line 72, in run

File "tenacity\__init__.py", line 480, in call

File "videotrans\translator\_microsoft.py", line 39, in _item_task

File "requests\models.py", line 1026, in raise_for_status

requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://api-edge.cognitive.microsofttranslator.com/translate?from=&to=fr&api-version=3.0&includeSentenceLength=true
cfg=TaskCfgSTS(uuid='d8c10b3765', name='E:/新建文件夹/有角色名/017.《 The White Snake 》.srt', dirname='E:/新建文件夹/有角色名', noextname='017.《 The White Snake 》', basename='017.《 The White Snake 》.srt', ext='srt', target_dir='D:/win-pyvideotrans/output/translate', cache_folder=None, is_cuda=False, source_language=None, source_language_code='en', source_sub='E:/新建文件夹/有角色名/017.《 The White Snake 》.srt', source_wav=None, source_wav_output=None, target_language=None, target_language_code='fr', target_sub='D:/win-pyvideotrans/output/translate/017.《 The White Snake 》.fr.srt', target_wav=None, target_wav_output=None, translate_type=0)


=
system:Windows-10-10.0.19045-SP0
version:v4.04
frozen:True
language:zh
root_dir:D:/win-pyvideotrans

1 Replies

这是由于微软翻译 API(已自动回退至该渠道)因短时间内请求过多触发的频率限制错误(HTTP 429)。软件在 Google 翻译失败后自动调用了微软翻译,但大量字幕行连续发送导致被限流。

解决方案

  1. 降低请求频率:打开 菜单 → 工具/选项 → 高级选项 → 字幕翻译调整,将 翻译后暂停秒 从默认值改为 10 或 15,给服务器足够的冷却时间。
  2. 减少每批发送量:在同一面板中,将 传统翻译渠道每批字幕行数 设为较小的值(如 5-10),避免一次性发送过多请求。
  3. 更换翻译渠道:如果以上调整后仍频繁限流,建议更换为国内稳定渠道(如 百度翻译腾讯翻译),它们对批量翻译支持更好,只需在翻译渠道列表中选中对应渠道并配置好 API Key 即可。

完成调整后,重新执行任务,错误应不再出现。

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.

Dondate via ko-fi.com

Dondate via PayPal

Related resource