#5090 requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

2409:8a55* Posted at: 21 hours ago

Expecting value: line 1 column 1 (char 0):
Traceback (most recent call last):
File "requests\models.py", line 976, in json
File "simplejson\__init__.py", line 514, in loads
File "simplejson\decoder.py", line 386, in decode
File "simplejson\decoder.py", line 416, in raw_decode
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 16, in run
File "videotrans\tts\__init__.py", line 184, in run
File "videotrans\tts\_base.py", line 134, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\tts\_ttsapi.py", line 46, in _run
File "requests\models.py", line 980, in json
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)


=
system:Windows-10-10.0.19045-SP0
version:v4.01
frozen:True
language:zh
root_dir:H:/PY/py-software/pyvideotrans

1 Replies

该错误表明调用自定义TTS-API时,服务返回的内容不是有效的 JSON(可能是 HTML 错误页面、空白响应或错误文本),导致软件解析失败。

解决方案:

  1. 检查自定义TTS-API地址:进入 菜单 → TTS设置 → 自定义TTS-API,确认填写的 API URL 路径、端口号和参数格式是否正确,且没有多余空格或换行。
  2. 确保服务正在运行:如果你使用的是本地部署的 TTS 服务(如 F5-TTS、CosyVoice、GPT-SoVITS 等),请确认该服务的终端窗口保持开启,且未报错退出。
  3. 测试接口可用性:在浏览器中直接访问该 API 地址(或使用 Postman 等工具),查看是否返回符合预期的 JSON 数据。如果返回的是 404500 错误,说明服务端配置有问题。
  4. 检查代理设置:如果 API 部署在远程服务器上,且你配置了代理(主界面中的“网络代理”),错误的代理设置可能导致请求被拦截或返回非 JSON 内容。建议先清空代理再进行测试。

请查阅相关文档:

如果以上步骤均无效,请提供 logs/ 目录下最新日志文件的完整内容(至少报错前后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

Similar issues already exist