#5641 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

该错误表明 AI 翻译渠道的返回结果为空,通常由以下原因导致:

  1. API Key 无效或余额不足 – 检查 DeepSeek、OpenAI 等渠道的密钥是否正确、账户余额是否充足。
  2. 模型名称不可用 – 在“菜单 → 翻译设置”中确认所选模型(如 deepseek-v4-flash)在当前渠道下有效。
  3. 网络连接异常 – 如使用国外服务(OpenAI、Gemini),请确保代理已正确填写(主界面 网络代理 框)。
  4. 上下文过长 – 若勾选了“发送完整字幕”,可尝试在高级选项→字幕翻译调整中降低AI翻译渠道每批字幕行数或关闭“发送完整字幕”。

请按以下步骤排查:

  • 打开 菜单 → 翻译设置,点击对应渠道右侧的 测试连接 按钮,查看是否提示成功。
  • 检查 logs/ 目录下最新 .log 文件,搜索 _openaicompat 附近的具体 HTTP 状态码或错误描述。
  • 如仍无法解决,请提供日志末尾 30 行内容,以及您所使用的翻译渠道和模型名称。

请查阅相关文档:

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