#5660 程序内部错误:'NoneType' object has no attribute 'get'Traceback (most recent call last): File "videotrans\translator\_base.py"

206.237* Posted at: 8 hours 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\task\only_one.py", line 67, in run
File "videotrans\task\_stage_translate.py", line 31, 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\_openaicompat.py", line 79, in _item_task
AttributeError: 'NoneType' object has no attribute 'get'

cfg=[TaskCfgVTT]当前工作模式: 翻译视频或音频 单视频模式
原始输入文件名: C:/Users/Administrator/Desktop/7月6日.mp4,
输出结果保存到文件夹: D:/video/7月6日-mp4,
临时文件夹: D:/win-pyvideotrans-v4.04-0704/tmp/39012/2dcb189fa0
已选 清理已存在
已选 启用CUDA加速
未选 降噪
语音识别:faster-whisper(本地内置), model_name: large-v3-turbo, 发音语言: 英语, 断句方式:默认断句
翻译渠道:OpenAI ChatGPT,原始语言:英语,目标语言:简体中文, 已选 发送完整字幕
配音渠道:Edge-TTS(免费), 角色:Yunyang(Male/CN), 配音语言:简体中文, 未选 二次语音识别
音量:+0%, 语速:+0%, 已选 音频加速, 未选 视频慢速
字幕: 嵌入硬字幕
已选 仅输出mp4
代理地址:


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

1 Replies

AttributeError: 'NoneType' object has no attribute 'get' 表示 OpenAI API 调用时返回了空对象或未正确获取配置,常见原因如下:

  1. 网络代理未配置:在中国大陆直连 OpenAI API 会被阻断。请在主界面设置代理(如 http://127.0.0.1:7890),或使用中转 API。
  2. API 密钥无效或余额不足:检查 菜单 → 翻译设置 → OpenAI ChatGPT 中的 API Key 是否正确,且账户余额充足。
  3. API 请求限流或超时:尝试在高级选项中减小“AI翻译渠道每批字幕行数”(如设为 10),并增大“翻译后暂停秒”(如 5 秒)。

解决步骤:

  • 若需科学上网,请确保代理客户端运行,并在软件主界面填写代理地址。
  • 若使用中转服务,请检查 API 地址和模型名是否正确(如 gpt-5.5 需确认中转支持)。
  • 清除翻译缓存(删除 tmp/translate_cache/ 目录)后重试。

请查阅相关文档:

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