#8546 Expecting value: line 1 column 1 (char 0):Traceback (most recent call last): File

107.172**1 Posted at: 2 hours ago

Expecting value: line 1 column 1 (char 0):Traceback (most recent call last):
File "videotrans\translator\_base.py", line 79, in run
File "videotrans\translator\_base.py", line 117, in _run_text
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 71, in run
File "videotrans\translator\_base.py", line 85, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_transapi.py", line 34, in _item_task
File "requests\models.py", line 980, in json
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)


=
system:Windows-10-10.0.26300-SP0
version:v4.16
frozen:True
language:zh_CN
root_dir:D:/win-pyvideotrans-v4.15

1 Replies

#1 DeepSeek reply at 2 hours ago

这是自定义翻译API(transapi 渠道)返回的内容不是合法 JSON导致的解析失败。requests.models.json() 尝试把响应体解析为 JSON,但当返回的是 HTML 错误页、纯文本报错、空内容或 404/500 页面时,就会在首个字符处抛 Expecting value: line 1 column 1 (char 0)。

排查与解决:

  1. 确认填的是正确的自定义API地址:自定义翻译API(自定义翻译API 渠道)不是"随便填个第三方接口就能用"的通用代理,它要求接口严格按 pyVideoTrans 规定的请求/响应 JSON 格式返回数据(包含翻译结果字段)。若你填的是 OpenAI 兼容接口,应改选 OpenAI ChatGPT 渠道 / OpenAI兼容渠道,而不是自定义翻译API。
  2. 直接用浏览器或 curl 测试该地址:将你在软件中填写的 api_url 放到浏览器访问,或 curl -X POST -d "...",看返回的是不是 JSON。若返回 HTML/登录页/ 之外的报错文本,说明地址、路径、鉴权或接口本身有问题。
  3. 检查密钥与鉴权方式:多数情况下 401/403 会返回非JSON的错误页。确认 API Key 填写位置正确(菜单 → 翻译设置 → 对应渠道),未被安全软件或代理拦截。
  4. 检查网络代理:若接口在境外,需在主界面"网络代理"填写 http://127.0.0.1:端口;国内接口则保持空白(软件内置免代理白名单)。
  5. 临时替代方案:先切换为 DeepSeek(推荐,物美价廉)或 Google(免费)/Microsoft(免费) 验证字幕翻译流程是否正常,以排除是渠道配置问题而非视频本身问题。

若确认接口自身返回正常 JSON,但仍报此错,请提供该接口的返回内容示例(脱敏后)以便进一步判断字段格式是否匹配。

请查阅相关文档:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
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 via ko-fi.com

Related resource