#6301 User location is not supported for the API use.Traceback (most recent call last):

45.125* Posted at: 1 hour ago

User location is not supported for the API use.
Traceback (most recent call last):
File "videotrans\translator\_gemini.py", line 91, in _item_task
File "google\genai\models.py", line 5407, in generate_content_stream
File "google\genai\models.py", line 4101, in _generate_content_stream
File "google\genai\_api_client.py", line 1405, in request_streamed
File "google\genai\_api_client.py", line 1224, in _request
File "tenacity\__init__.py", line 477, in call
File "tenacity\__init__.py", line 378, in iter
File "tenacity\__init__.py", line 420, in exc_check
File "tenacity\__init__.py", line 187, in reraise
File "concurrent\futures\_base.py", line 451, in result
File "concurrent\futures\_base.py", line 403, in __get_result
File "tenacity\__init__.py", line 480, in call
File "google\genai\_api_client.py", line 1189, in _request_once
File "google\genai\errors.py", line 121, in raise_for_response
File "google\genai\errors.py", line 146, in raise_error
google.genai.errors.ClientError: 400 FAILED_PRECONDITION. {'error': {'code': 400, 'message': 'User location is not supported for the API use.', 'status': 'FAILED_PRECONDITION'}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\task\only_one.py", line 83, in run
File "videotrans\task\_stage_translate.py", line 31, in trans
File "videotrans\translator\_runner.py", line 63, in run
File "videotrans\translator\_base.py", line 71, in run
File "videotrans\translator\_base.py", line 204, in _run_srt
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 400, in
File "concurrent\futures\_base.py", line 451, in result
File "concurrent\futures\_base.py", line 403, in __get_result
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_gemini.py", line 113, in _item_task
videotrans.configure.excepts.StopTask: User location is not supported for the API use.

cfg=[TaskCfgVTT]当前工作模式: 翻译视频或音频 单视频模式
原始输入文件名: D:/video/V ng i ta iu cho vui v thoiiii.mp4,
输出结果保存到文件夹: D:/video/_video_out/V ng i ta iu cho vui v thoiiii-mp4,
临时文件夹: D:/pyVideoTrans/win-pyvideotrans-v4.07/tmp/4212/c4c34a6cb3
已选 清理已存在
已启用CUDA加速
未选 降噪
语音识别:ElevenLabs.io, model_name: , 发音语言: 越南语, 断句方式:LLM重新断句
翻译渠道:Gemini AI,原始语言:越南语,目标语言:简体中文, 已选 发送完整字幕
未选 配音角色,不进行配音
字幕: 嵌入硬字幕
已选 分离人声与背景声, 已选 重新嵌入背景声, 背景音量0.8, 背景声音时长 短于 视频时长时: 拉长(降速播放),存在分离后的纯净人声文件,存在分离后的背景声音文件
代理地址:


=
system:Windows-10-10.0.22631-SP0
version:v4.08
frozen:True
language:zh
root_dir:D:/pyVideoTrans/win-pyvideotrans-v4.07

1 Replies

该报错是 Google Gemini API 按地区限制导致的:你的出口 IP 所在地区不支持使用 Gemini API,因此请求被拒绝并提示 User location is not supported for the API use

解决方案按下述步骤尝试:

  1. 在主界面「网络代理」处填写可用的代理地址(格式如 http://127.0.0.1:7890socks5://127.0.0.1:端口),确保代理出口 IP 位于 Gemini 支持的国家/地区,然后重新执行。
  2. 检查代理是否全局生效,或临时关闭系统代理后重试;若代理不稳定也会导致同样失败。
  3. 若无法使用代理或仍提示地区不支持,建议更换翻译渠道,例如使用 DeepSeek、智谱AI、阿里百炼等国内可用渠道,效果和稳定性更好。

补充:日志中显示你使用了「LLM重新断句」和「Gemini翻译」,Gemini 翻译不可用时其余流程也会延续报错;更换翻译渠道后建议也确认「LLM重新断句」所用 AI 渠道可用,否则仍可能卡在同类网络/地区限制问题上。

请查阅相关文档:

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.

Dondate via ko-fi.com

Dondate via PayPal

Related resource