#4022 TaskCfgVTT(is_cuda=False, uuid='ec830a27b2', cache_folder='/Users/a1/Applications/pyvideotrans-app/pyvideotrans/tmp/4815

103.142* Posted at: 4 hours ago 👁12

翻译字幕阶段出错 [OpenAI ChatGPT] Invalid project resource name projects/projects/random-c3616159/locations/global
Traceback (most recent call last):
File "/Users/a1/Applications/pyvideotrans-app/pyvideotrans/videotrans/task/job.py", line 173, in run

trk.trans()

File "/Users/a1/Applications/pyvideotrans-app/pyvideotrans/videotrans/task/trans_create.py", line 658, in trans

target_srt = run_trans(

File "/Users/a1/Applications/pyvideotrans-app/pyvideotrans/videotrans/translator/__init__.py", line 966, in run

return ChatGPT(**kwargs).run()

File "/Users/a1/Applications/pyvideotrans-app/pyvideotrans/videotrans/translator/_base.py", line 97, in run

return self._run_srt(split_source_text)

File "/Users/a1/Applications/pyvideotrans-app/pyvideotrans/videotrans/translator/_base.py", line 161, in _run_srt

result = self._item_task(srt_str)

File "/Users/a1/Applications/pyvideotrans-app/pyvideotrans/.venv/lib/python3.10/site-packages/tenacity/__init__.py", line 338,
......
env/lib/python3.10/site-packages/openai/resources/chat/completions/completions.py", line 1211, in create

return self._post(

File "/Users/a1/Applications/pyvideotrans-app/pyvideotrans/.venv/lib/python3.10/site-packages/openai/_base_client.py", line 1297, in post

return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))

File "/Users/a1/Applications/pyvideotrans-app/pyvideotrans/.venv/lib/python3.10/site-packages/openai/_base_client.py", line 1070, in request

raise self._make_status_error_from_response(err.response) from None

openai.BadRequestError: Error code: 400 - {'error': {'message': 'Invalid project resource name projects/projects/random-c3616159/locations/global', 'type': 'upstream_error', 'param': '', 'code': 400}}
TaskCfgVTT(is_cuda=False, uuid='ec830a27b2', cache_folder='/Users/a1/Applications/pyvideotrans-app/pyvideotrans/tmp/48158/ec830a27b2', target_dir='/Volumes/185XXXX5717/4070硬盘备份/视频处理/YouTube视频合集/Lessons in the Tao and Kung Fu which means Inner Truth with Desi and Sterling and the TV series Kung Fu/_video_out/13_The Matrix Was a Documentary-mp4', source_language='英语', source_language_code='en', source_sub='/Volumes/185XXXX5717/4070硬盘备份/视频处理/YouTube视频合集/Lessons in the Tao and Kung Fu which means Inner Truth with Desi and Sterling and the TV series Kung Fu/_video_out/13_The Matrix Was a Documentary-mp4/en.srt', source_wav='/Users/a1/Applications/pyvideotrans-app/pyvideotrans/tmp/48158/ec830a27b2/en.wav', source_wav_output='/Volumes/185XXXX5717/4070硬盘备份/视频处理/YouTube视频合集/Lessons in the Tao and Kung Fu which means Inner Truth with Desi and Sterling and the TV series Kung Fu/_video_out/13_The Matrix Was a Documentary-mp4/en.m4a', target_language='简体中文', target_language_code='zh-cn', target_sub='/Volumes/185XXXX5717/4070硬盘备份/视频处理/YouTube视频合集/Lessons in the Tao and Kung Fu which means Inner Truth with Desi and Sterling and the TV series Kung Fu/_video_out/13_The Matrix Was a Documentary-mp4/zh-cn.srt', target_wav='/Users/a1/Applications/pyvideotrans-app/pyvideotrans/tmp/48158/ec830a27b2/target.wav', target_wav_output='/Volumes/185XXXX5717/4070硬盘备份/视频处理/YouTube视频合集/Lessons in the Tao and Kung Fu which means Inner Truth with Desi and Sterling and the TV series Kung Fu/_video_out/13_The Matrix Was a Documentary-mp4/zh-cn.m4a', name='/Volumes/185XXXX5717/4070硬盘备份/视频处理/YouTube视频合集/Lessons in the Tao and Kung Fu which means Inner Truth with Desi and Sterling and the TV series Kung Fu/13_The Matrix Was a Documentary.mp4', noextname='13_The Matrix Was a Documentary', basename='13_The Matrix Was a Documentary.mp4', ext='mp4', dirname='/Volumes/185XXXX5717/4070硬盘备份/视频处理/YouTube视频合集/Lessons in the Tao and Kung Fu which means Inner Truth with Desi and Sterling and the TV series Kung Fu', shound_del_name=None, translate_type=3, tts_type=0, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role='No', voice_autorate=False, video_autorate=False, remove_silent_mid=False, align_sub_audio=True, detect_language='en', recogn_type=15, model_name='large-v3', shibie_audio=None, remove_noise=False, enable_diariz=False, nums_diariz=0, rephrase=0, fix_punc=False, subtitle_language=None, app_mode='tiqu', subtitles='', targetdir_mp4='/Volumes/185XXXX5717/4070硬盘备份/视频处理/YouTube视频合集/Lessons in the Tao and Kung Fu which means Inner Truth with Desi and Sterling and the TV series Kung Fu/_video_out/13_The Matrix Was a Documentary-mp4/13_The Matrix Was a Documentary.mp4', novoice_mp4='/Users/a1/Applications/pyvideotrans-app/pyvideotrans/tmp/48158/ec830a27b2/novoice.mp4', is_separate=False, instrument=None, vocal=None, back_audio='', clear_cache=False, background_music=None, subtitle_type=0, only_out_mp4=False, recogn2pass=True, output_srt=0, copysrt_rawvideo=False, output_bilingual_srt=True)


=
system:macOS-26.4-arm64-i386-64bit
version:v3.98
frozen:False
language:zh
root_dir:/Users/a1/Applications/pyvideotrans-app/pyvideotrans
Python: 3.10.19 (main, Feb 12 2026, 00:36:33) [Clang 21.1.4 ]

1 Replies

这是由于 OpenAI ChatGPT 翻译渠道的 API 配置中项目资源名称格式错误导致的。错误信息显示项目资源名称为 projects/projects/random-c3616159/locations/global,其中包含了重复的 projects/ 前缀。

  1. 请检查并修正 OpenAI API 配置中的“项目名称”或“项目ID”。

    • 在软件顶部菜单中,点击 菜单 -> 翻译设置 -> OpenAI ChatGPT
    • 在设置面板中,找到 项目名称项目ID 字段。
    • 确保其格式正确,通常应为 projects/你的项目ID/locations/global 或直接填写你的项目ID。根据错误信息,你需要将配置从 projects/projects/random-c3616159/locations/global 修正为 projects/random-c3616159/locations/global
  2. 确认你的 API Key 和 Base URL 是否正确,并确保该 API Key 拥有对应项目的访问权限。
  3. 保存设置后,重新尝试翻译任务。

请查阅相关文档:

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