#5207 FREE GPT API:Traceback (most recent call last): File "videotrans\translator\_base.py", line 72, in run File "videotran

13.231* Posted at: 3 hours ago

FREE GPT API:Traceback (most recent call last):
File "videotrans\translator\_base.py", line 72, in run
File "videotrans\translator\_base.py", line 142, 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 421, in exc_check
tenacity.RetryError: RetryError[]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\util\TestSrtTrans.py", line 19, in run
File "videotrans\translator\__init__.py", line 858, in run
File "videotrans\translator\_base.py", line 75, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_openaicompat.py", line 78, in _item_task
videotrans.configure.excepts.TranslateSrtError: FREE GPT API


=
system:Windows-10-10.0.19045-SP0
version:v4.02
frozen:True
language:zh
root_dir:E:/AI/pyvideotrrans

1 Replies

翻译失败的根本原因是您配置的 兼容AI/本地模型翻译渠道 的 API 地址或 API 密钥不正确,导致请求被重定向到一个免费的 GPT API 宣传页面(返回了 HTML 而非 JSON 数据)。

请按以下步骤排查:

  1. 检查 API 地址:打开 菜单 → 翻译设置 → 兼容AI/本地模型,确认填写的地址格式应为 https://api.xxx.com/v1/chat/completions(必须以 /v1/chat/completions 结尾),不能是普通的网页首页地址。
  2. 确认 API 密钥:如果使用第三方服务(如 DeepSeek、OpenAI 兼容接口),请确保密钥有效且未过期,并在对应的设置面板中正确填写。
  3. 网络代理:若您的 API 服务需要科学上网,请在主界面第 5 行的 网络代理 处正确填写代理地址(例如 http://127.0.0.1:7890);若不需要,请保持为空。
  4. 验证连通性:您可以尝试在浏览器中直接访问该 API 地址(加上您的密钥),看是否返回 JSON 格式的错误信息,还是返回该 HTML 页面。如果返回 HTML,说明地址或密钥有误。

修正后重新执行翻译任务即可。

请查阅相关文档:

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: ko-fi.com/jianchang512

Related resource

Similar issues already exist