#1550 google.genai.errors.ClientError: 400 FAILED_PRECONDITION. {'error': {'code': 400, 'message': 'User location is not suppo

152.70* Posted at: 1 day ago 👁9

网络连接失败:
Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 18, in run
File "videotrans\tts\__init__.py", line 315, in run
File "videotrans\tts\_base.py", line 177, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\tts\_geminitts.py", line 48, in _run
File "videotrans\tts\_geminitts.py", line 169, in generate_tts_segment
File "google\genai\models.py", line 5783, in generate_content_stream
File "google\genai\models.py", line 4666, in _generate_content_stream
File "google\genai\_api_client.py", line 774, in request_streamed
File "google\genai\_api_client.py", line 672, in _request
File "google\genai\errors.py", line 101, in raise_for_response
google.genai.errors.ClientError: 400 FAILED_PRECONDITION. {'error': {'code': 400, 'message': 'User location is not supported for the API use.', 'status': 'FAILED_PRECONDITION'}}


=
system:Windows-10-10.0.26200-SP0
version:v3.85
frozen:True
language:zh
root_dir:D:/MyApp/VideoTrans

1 Replies

这个错误是因为您所在的地理位置无法使用 Google Gemini TTS 服务。错误信息明确显示 "User location is not supported for the API use."。

请按以下步骤解决:

  1. 更换配音渠道:在配音设置中,将 Gemini TTS 更换为其他可用渠道,如:

    • Edge-TTS(免费推荐)
    • Azure TTS
    • OpenAI TTS
    • 字节火山 TTS
  2. 检查代理设置:如果您需要使用 Gemini 服务,请确保:

    • 在主界面第5行正确设置了网络代理
    • 代理服务器位于支持 Gemini 服务的地区
  3. 验证API密钥:如果您坚持使用 Gemini,请确认在设置中填写的 API 密钥有效且具有 TTS 权限。

最直接的解决方案是切换到 Edge-TTS 或其他不受地理位置限制的配音服务。

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