#5640 AttributeError: 'NoneType' object has no attribute 'get'

123.110* Posted at: 1 day ago

程序内部错误:'NoneType' object has no attribute 'get':Traceback (most recent call last):
File "videotrans\translator\_base.py", line 69, in run
File "videotrans\translator\_base.py", line 143, 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\_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\_openaicompat.py", line 79, in _item_task
AttributeError: 'NoneType' object has no attribute 'get'


=
system:Windows-10-10.0.19043-SP0
version:v4.04
frozen:True
language:zh
root_dir:D:/pyvideotrans4040704

1 Replies

这是翻译渠道配置错误。'NoneType' object has no attribute 'get' 通常是因为 AI 翻译渠道的 API 地址、API Key 或模型名称未正确填写,导致返回的数据为 None

解决步骤:

  1. 打开主界面顶部 菜单 → 翻译设置,检查当前使用的翻译渠道(如 DeepSeek、OpenAI、兼容AI等)的配置:

    • API 地址:必须填写完整的 URL(例如 https://api.deepseek.com),不能为空或错误。
    • API Key:确保密钥已正确输入且余额充足。
    • 模型名称:需选择或填写有效的模型名(如 deepseek-chatgpt-4o),不能留空。
  2. 如果你使用的是 兼容AI/本地模型 渠道,请进入 菜单 → 翻译设置 → 本地大模型设置,填写正确的 API 地址(需兼容 OpenAI 接口格式)。
  3. 保存配置后重启软件,重新执行任务。

请查阅相关文档:

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