#3193 TaskCfg(cache_folder=None, target_dir='d:/spfy/output/translate', remove_noise=False, is_separate=False, detect_language

188.253* Posted at: 8 hours ago 👁7

翻译字幕阶段出错 [阿里百炼] 程序内部错误:'NoneType' object is not subscriptable
Traceback (most recent call last):
File "videotrans\task\job.py", line 184, in run
File "videotrans\task\_translate_srt.py", line 45, in trans
File "videotrans\translator\__init__.py", line 885, in run
File "videotrans\translator\_base.py", line 79, in run
File "videotrans\translator\_base.py", line 96, in _run_text
File "videotrans\translator\_qwenmt.py", line 61, in _item_task
TypeError: 'NoneType' object is not subscriptable

TaskCfg(cache_folder=None, target_dir='d:/spfy/output/translate', remove_noise=False, is_separate=False, detect_language=None, subtitle_language=None, source_language=None, target_language=None, source_language_code='auto', target_language_code='Chinese', source_sub='D:/视频下载/_video_out/Astronomers Just Found Earth s Secret Second Moon (1)-mp4/en.srt', target_sub='d:/spfy/output/translate/en.Chinese.srt', source_wav=None, source_wav_output=None, target_wav=None, target_wav_output=None, subtitles=None, novoice_mp4=None, noextname='en', shibie_audio=None, targetdir_mp4=None, instrument=None, vocal=None, back_audio=None, background_music=None, app_mode='biaozhun', subtitle_type=0, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role=None, copysrt_rawvideo=False, clear_cache=False, translate_type=12, tts_type=None, recogn_type=None, model_name=None, split_type=0, voice_autorate=False, video_autorate=False, cuda=False, name='D:/视频下载/_video_out/Astronomers Just Found Earth s Secret Second Moon (1)-mp4/en.srt', basename='en.srt', ext='srt', dirname='D:/视频下载/_video_out/Astronomers Just Found Earth s Secret Second Moon (1)-mp4', shound_del_name=None, uuid='574bcbb734', remove_silent_mid=False, align_sub_audio=True, enable_diariz=False, nums_diariz=0, rephrase=2, only_out_mp4=False)


=
system:Windows-10-10.0.19045-SP0
version:v3.92
frozen:True
language:zh
root_dir:D:/SPFY

1 Replies

这是由于阿里百炼翻译渠道在翻译字幕时,API返回了空值(None)导致的。

解决方案:

  1. 检查API配置:确认在“翻译设置”->“阿里百炼”中填写的API Key和API URL(通常为 https://dashscope.aliyuncs.com/compatible-mode/v1)正确无误。
  2. 检查模型名称:确认“模型名称”填写正确(例如 qwen-maxqwen-plus 等),并且该模型在阿里百炼平台已开通且状态正常。
  3. 调整翻译方式:在“高级选项”->“翻译参数”中,尝试取消勾选“发送完整字幕”选项,改为按行翻译。
  4. 降低并发:在“高级选项”->“翻译参数”中,将“同时翻译线程数”设置为 1,以降低请求频率。
  5. 切换翻译渠道:如果以上步骤无效,可以暂时切换到其他翻译渠道(如DeepSeek、OpenAI等)完成当前任务,并检查阿里百炼平台的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.

Related resource