#5647 代理地址:http://127.0.0.1:7897

45.202* Posted at: 19 hours ago

翻译字幕阶段出错 [Gemini AI] User location is not supported for the API use.
Traceback (most recent call last):

File "videotrans\translator\_gemini.py", line 89, 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\job.py", line 35, in run

File "videotrans\task\job.py", line 135, in process_task

File "videotrans\task\trans_create.py", line 608, in trans

File "videotrans\translator\__init__.py", line 860, in run

File "videotrans\translator\_base.py", line 68, in run

File "videotrans\translator\_base.py", line 142, 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 111, in _item_task

videotrans.configure.excepts.StopTask: User location is not supported for the API use.
cfg=[TaskCfgVTT]当前工作模式: 转录并翻译字幕
原始输入文件名: G:/油管/[📹Hearting] 짝사랑 도와주다 망친 썰 💭 - ‘Say It’ MV Behind.mp4,
输出结果保存到文件夹: G:/油管/[📹Hearting] 짝사랑 도와주다 망친 썰 💭 - ‘Say It’ MV Behind-mp4,
临时文件夹: E:/py/win-pyvideotrans-v4.02-0615/tmp/18484/fdeec961d6
未选 清理已存在
已选 启用CUDA加速
未选 降噪
语音识别:faster-whisper(本地内置), model_name: large-v3-turbo, 发音语言: 韩语, 断句方式:默认断句
翻译渠道:Gemini AI,原始语言:韩语,目标语言:简体中文, 已选 发送完整字幕
输出字幕格式: 目标语言在下双字幕
代理地址:http://127.0.0.1:7897


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

1 Replies

翻译出错是因为 Gemini AI 的 API 在你当前网络所在地区不可用(User location is not supported)。你虽然设置了代理 http://127.0.0.1:7897,但可能该代理无法正常访问 Google Gemini 服务,或代理配置有误。


解决步骤

  1. 确认代理有效性
    用浏览器打开 https://generativelanguage.googleapis.com,看能否正常访问。若无法访问,说明代理无效或需要更换。
  2. 检查代理格式
    确保代理地址格式正确,如 http://127.0.0.1:7897(不要遗漏 http:// 或端口号)。
    如果使用的是 SOCKS5 代理,格式应为 socks5://127.0.0.1:端口
  3. 临时关闭代理测试
    若代理本可正常使用,但 Gemini 仍报此错,可尝试清空软件中的代理设置,改用系统全局代理(VPN)再试。
  4. 更换翻译渠道
    建议改用国内可用的 AI 翻译渠道,如 DeepSeek智谱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: ko-fi.com/jianchang512

Related resource