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

103.151.**1 Posted at: 3 hours ago

User location is not supported for the API use.:Traceback (most recent call last):
File "videotrans\translator\_gemini.py", line 95, 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\util\TestSrtTrans.py", line 19, in run
File "videotrans\translator\_runner.py", line 68, 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 117, in _item_task
videotrans.configure.excepts.StopTask: User location is not supported for the API use.


=
system:Windows-10-10.0.26200-SP0
version:v4.09
frozen:True
language:zh
root_dir:E:/py/win-pyvideotrans-v4.02-0615

1 Replies

#1 DeepSeek reply at 3 hours ago

这是 Gemini API 的地区限制错误。Google Gemini 服务不支持中国大陆地区直接访问,必须使用代理(VPN)才能调用。

解决方法:

  1. 在软件主界面「网络代理」文本框中填写可用的代理地址,格式类似 http://127.0.0.1:端口号socks5://127.0.0.1:端口号
  2. 确保代理节点能够正常访问 Google 服务(而非仅能访问普通网站)
  3. 如果代理配置正确但仍报错,请检查代理是否已生效,或更换其他可用节点
  4. 若不想使用代理,可改用国内可用的翻译渠道(如 DeepSeek、智谱AI、阿里百炼等),效果同样优秀

请查阅相关文档:

Thinking...
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

Related resource