#1829 TaskCfg(cache_folder='D:/win-pyvideotrans-v3.86/tmp37660/aaf4a10a40', target_dir='C:/Users/Administrator/Desktop/世界优势/课程

103.129* Posted at: 1 day ago 👁17

翻译字幕阶段出错:[自定义翻译API] Expecting value: line 1 column 1 (char 0):
Traceback (most recent call last):
File "videotrans\translator\_base.py", line 78, in run
File "videotrans\translator\_base.py", line 95, 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\task\job.py", line 184, in run
File "videotrans\task\trans_create.py", line 423, in trans
File "videotrans\translator\__init__.py", line 898, in run
File "videotrans\translator\_base.py", line 80, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_transapi.py", line 44, in _item_task
File "requests\models.py", line 980, in json
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

TaskCfg(cache_folder='D:/win-pyvideotrans-v3.86/tmp37660/aaf4a10a40', target_dir='C:/Users/Administrator/Desktop/世界优势/课程2025 - Course/1. 入门/_video_out/1. What is Trading_', remove_noise=False, is_separate=False, detect_language='en', subtitle_language=None, source_language='英语', target_language='简体中文', source_language_code='en', target_language_code='zh-cn', source_sub='C:/Users/Administrator/Desktop/世界优势/课程2025 - Course/1. 入门/_video_out/1. What is Trading_/en.srt', target_sub='C:/Users/Administrator/Desktop/世界优势/课程2025 - Course/1. 入门/_video_out/1. What is Trading_/zh-cn.srt', source_wav='D:/win-pyvideotrans-v3.86/tmp37660/aaf4a10a40/en.wav', source_wav_output='C:/Users/Administrator/Desktop/世界优势/课程2025 - Course/1. 入门/_video_out/1. What is Trading_/en.m4a', target_wav='D:/win-pyvideotrans-v3.86/tmp37660/aaf4a10a40/target.wav', target_wav_output='C:/Users/Administrator/Desktop/世界优势/课程2025 - Course/1. 入门/_video_out/1. What is Trading_/zh-cn.m4a', subtitles='', novoice_mp4='D:/win-pyvideotrans-v3.86/tmp37660/aaf4a10a40/novoice.mp4', noextname='1. What is Trading_', shibie_audio=None, targetdir_mp4='C:/Users/Administrator/Desktop/世界优势/课程2025 - Course/1. 入门/_video_out/1. What is Trading_/1. What is Trading_.mp4', instrument=None, vocal=None, back_audio='', background_music=None, app_mode='biaozhun', subtitle_type=1, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role='No', copysrt_rawvideo=False, clear_cache=False, translate_type=21, tts_type=0, recogn_type=0, model_name='large-v3', split_type=0, voice_autorate=False, video_autorate=False, cuda=True, name='C:/Users/Administrator/Desktop/世界优势/课程2025 - Course/1. 入门/1. What is Trading_.mp4', basename='1. What is Trading_.mp4', ext='mp4', dirname='C:/Users/Administrator/Desktop/世界优势/课程2025 - Course/1. 入门', shound_del_name=None, uuid='aaf4a10a40', remove_silent_mid=False, align_sub_audio=False, enable_diariz=False, nums_diariz=0, auto_fix=True)


=
system:Windows-10-10.0.26100-SP0
version:v3.86
frozen:True
language:zh
root_dir:D:/win-pyvideotrans-v3.86

1 Replies

错误 [自定义翻译API] Expecting value: line 1 column 1 (char 0) 表明您配置的自定义翻译API返回了非JSON格式的响应,导致软件无法解析。这通常是API服务器返回了错误页面(如404、500错误)或直接返回了HTML/纯文本。

请按以下步骤排查:

  1. 检查API地址和参数:在菜单栏选择 工具/选项 -> 翻译设置,找到您配置的“自定义翻译API”部分。请确保:

    • API地址 填写正确且完整(例如 http://127.0.0.1:5000/translate)。
    • 请求体格式 完全符合您自建翻译服务的要求。软件默认会发送 {"text": "待翻译文本", "target_language": "zh-cn"} 格式的数据,您的服务必须能接收并返回 {"result": "翻译后的文本"} 格式的JSON。
  2. 测试API连通性:使用浏览器或 curl 等工具手动测试您的API。例如,在命令行执行:

    curl -X POST "http://您的API地址" -H "Content-Type: application/json" -d "{\"text\": \"Hello\", \"target_language\": \"zh-cn\"}"

    检查返回的内容是否为纯JSON,且没有额外的HTML标签或错误信息。

  3. 查看服务端日志:检查您自建翻译服务的日志,确认它是否收到了请求、处理是否成功、以及返回了什么。
  4. 临时解决方案:如果无法立即修复自定义API,请在主界面第3行的“翻译渠道”中,临时切换为其他可用的翻译服务(如Google、DeepSeek等)以继续工作。

如果问题依旧,请提供您配置的自定义翻译API的详细信息(地址、请求体格式)以及其服务端的错误日志。

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

Trending Questions