点击查看 Edge-TTS 配音渠道无法使用的解决办法!!!

#859 'NoneType' object is not subscriptable

202.8* Posted at: 2 months ago 👁103

'NoneType' object is not subscriptable

=====

Windows-10-10.0.27954-SP0

version:v3.81

frozen:True

language:zh

3 Replies

本条内容由 DeepSeek 回复
这个错误 'NoneType' object is not subscriptable 通常发生在软件试图访问一个值为 None 的变量,就像它是一个列表或字典一样。在 pyVideoTrans v3.81 中,这可能是由于配置文件读取失败、某些API返回了空值,或软件内部状态异常导致的。

解决方案:

1. 检查并重置配置文件

  • 关闭软件。
  • 前往软件安装目录下的 videotrans 文件夹。
  • 找到并删除 params.jsoncfg.json 文件(删除前可先备份)。
  • 重新启动软件,这会重置所有设置到默认状态,请重新配置您的API密钥等必要信息。

2. 提供详细日志

  • 如果问题依然存在,请打开软件目录下的 logs 文件夹。
  • 找到以当前日期命名的 .log 文件(例如 20241219.log)。
  • 将文件末尾的 30-50 行 错误日志复制并回复在此,这将帮助我们更精确地定位问题。

如果以上步骤无法解决,建议从官方网站重新下载最新版本的软件包进行覆盖安装。


==准备要嵌入的字幕:self.cfg.subtitle_type=2
=
2025-11-29 15:01:56,335 - INFO - 返回缓存的编解码器 Windows-264: h264_nvenc
2025-11-29 15:02:41,348 - INFO - Starting call to 'videotrans.tts._f5tts.F5TTS._item_task.._run', this is the 1st time calling it.
2025-11-29 15:02:41,448 - INFO - Finished call to 'videotrans.tts._f5tts.F5TTS._item_task.._run' after 0.094(s), this was the 1st time calling it.
2025-11-29 15:02:46,457 - INFO - Starting call to 'videotrans.tts._f5tts.F5TTS._item_task.._run', this is the 2nd time calling it.
2025-11-29 15:02:46,495 - INFO - Finished call to 'videotrans.tts._f5tts.F5TTS._item_task.._run' after 5.140(s), this was the 2nd time calling it.
2025-11-29 15:03:19,088 - INFO - Starting call to 'videotrans.tts._f5tts.F5TTS._item_task.._run', this is the 1st time calling it.
2025-11-29 15:03:19,101 - INFO - index-tts data={'ref_wav': 'D:/pyvideotrans-3.83/f5-tts/Maxim.wav'}
2025-11-29 15:03:23,013 - INFO - result={'visible': True, 'value': 'C:\Users\Administrator
......

用户输入\n\n[\n {\'word\': \'这\', \'start\': 2.1, \'end\': 2.2},\n {\'word\': \'里是\', \'start\': 2.3, \'end\': 2.6},\n {\'word\': \'机\', \'start\': 2.8, \'end\': 2.9},\n {\'word\': \'场吗\', \'start\': 3.0, \'end\': 3.5},\n {\'word\': \'以经\', \'start\': 4.2, \'end\': 4.5},\n {\'word\': \'很晚\', \'start\': 4.6, \'end\': 5.0}\n]\n\n#### 你的 JSON 输出\njson\n{\n "subtitles": [\n {\n "start": 2.1,\n "end": 3.5,\n "text": "这里是机场吗?"\n },\n {\n "start": 4.2,\n "end": 5.0,\n "text": "已经很晚了。"\n }\n ]\n}\n\n\n
\n\n## 执行前最终检查\n\n在你生成最终答案之前,请在内部进行最后一次检查,确保你的输出 100% 符合以下规则:\n\n1. 最终输出是否是合法的 json 对象{...} -> (是/否)\n2. 该 JSON 对象是否包含一个名为 \'subtitles\' 的键? -> (是/否)\n3. \'subtitles\' 的值是否是一个列表 [...],且列表中的每一个元素都是一个合法的 JSON 对象{...} -> (是/否)\n4. 列表中的每个字典是否都只包含 \'start\', \'end\', \'text\' 这三个键? -> (是/否)\n5. 最关键的一点:键名是否是 \'text\',而不是 \'word\' -> (是/否)\n\n只有当以上所有问题的答案都是“是”时,才生成你的最终输出。\n'}, {'role': 'user', 'content': '[{"start": 181.88, "end": 182.18, "word": " team."}, {"start": 182.55, "end": 182.65, "word": " And"}, {"start": 182.65, "end": 182.87, "word": " that\'s"}, {"start": 182.87, "end": 183.01, "word": " how"}, {"start": 183.01, "end": 183.23, "word": " skills"}, {"start": 183.23, "end": 183.51, "word": " can"}, {"start": 183.51, "end": 183.71, "word": " help"}, {"start": 183.71, "end": 183.85, "word": " you"}, {"start": 183.85, "end": 184.11, "word": " achieve"}, {"start": 184.11, "end": 184.37, "word": " more"}, {"start": 184.37, "end": 184.59, "word": " with"}, {"start": 184.59, "end": 184.95, "word": " Claude."}, {"start": 185.37, "end": 185.51, "word": " We"}, {"start": 185.51, "end": 185.81, "word": " encourage"}, {"start": 185.81, "end": 185.95, "word": " you"}, {"start": 185.95, "end": 186.09, "word": " to"}, {"start": 186.09, "end": 186.23, "word": " give"}, {"start": 186.23, "end": 186.35, "word": " them"}, {"start": 186.35, "end": 186.55, "word": " a"}, {"start": 186.55, "end": 186.79, "word": " try"}, {"start": 186.79, "end": 187.23, "word": " and"}, {"start": 187.23, "end": 187.41, "word": " see"}, {"start": 187.41, "end": 187.59, "word": " how"}, {"start": 187.59, "end": 187.77, "word": " they"}, {"start": 187.77, "end": 187.93, "word": " can"}, {"start": 187.93, "end": 188.27, "word": " improve"}, {"start": 188.27, "end": 188.55, "word": " your"}, {"start": 188.55, "end": 188.93, "word": " works."}]'}]

2025-11-29 15:07:50,998 - INFO - 第2批次 LLM断句,每批次 500 个字或单词
2025-11-29 15:07:55,576 - INFO - 第2批次 LLM断句 完成
2025-11-29 15:07:55,576 - INFO - LLM断句结果:sub_list=[{'start': 181.88, 'end': 184.95, 'text': "Team, and that's how skills can help you achieve more with Claude."}, {'start': 185.37, 'end': 188.93, 'text': 'We encourage you to give them a try and see how they can improve your work.'}]
2025-11-29 15:08:59,629 - INFO -


==准备要嵌入的字幕:self.cfg.subtitle_type=2
=

从日志分析,您遇到的 'NoneType' object is not subscriptable 错误很可能发生在 LLM 大模型断句处理阶段。问题出现在软件尝试解析 LLM 返回的断句结果时,某个变量意外为 None。

解决方案:

  1. 临时禁用 LLM 断句:

    • 在主界面的第 2 行 "语音识别" 区域,将 "断句设置" 从 LLM大模型重断句 切换为 默认断句本地算法重断句
    • 重新处理视频,看是否能够成功完成。
  2. 检查并重置 LLM 配置:

    • 如果必须使用 LLM 断句,请前往菜单栏的 翻译设置
    • 检查您配置的 LLM 模型(如 OpenAI、DeepSeek 等)的 API Key 和 Base URL 是否正确。
    • 尝试在 "翻译设置" 中,将 "同时翻译字幕数" 设置为 1,以降低请求复杂度。
  3. 提供更详细的日志:

    • 如果问题依旧,请提供包含完整错误堆栈跟踪的日志。错误发生时的日志行应该紧跟在您提供的 ==准备要嵌入的字幕... 这行之后。请检查 logs 文件夹中当天的日志文件,找到并复制完整的错误信息。

这个错误通常是 LLM 服务响应异常或软件解析逻辑的边界情况所致,优先使用本地算法断句是最高效的解决方式。

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.

Donate: https://ko-fi.com/jianchang512

Similar issues already exist

Trending Questions