#2454 TaskCfg(cache_folder=None, target_dir='C:/Ruanjian/win-pyvideotrans-v3.91/output/translate', remove_noise=False, is_sepa

2a11:840* Posted at: 1 month ago 👁74

翻译字幕阶段出错 [Gemini AI] You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/usage?tab=rate-limit.

  • Quota exceeded for metric: generativelanguage.googleapis.com/generate_content_free_tier_requests, limit: 20, model: gemini-2.5-flash
    Please retry in 18.449330921s.
    Traceback (most recent call last):
    File "videotrans\translator\_gemini.py", line 111, in _item_task
    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: 429 RESOURCE_EXHAUSTED. {'error': {'code': 429, 'message': 'You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/usage?tab=rate-limit. * Quota exceeded for metric: generativelanguage.googleapis.com/generate_content_free_tier_requests, limit: 20, model: gemini-2.5-flash Please retry in 18.449330921s.', 'status': 'RESOURCE_EXHAUSTED', 'details': [{'@type': 'type.googleapis.com/google.rpc.Help', 'links': [{'description': 'Learn more about Gemini API quotas', 'url': 'https://ai.google.dev/gemini-api/docs/rate-limits'}]}, {'@type': 'type.googleapis.com/google.rpc.QuotaFailure', 'violations': [{'quotaMetric': 'generativelanguage.googleapis.com/generate_content_free_tier_requests', 'quotaId': 'GenerateRequestsPerDayPerProjectPerModel-FreeTier', 'quotaDimensions': {'location': 'global', 'model': 'gemini-2.5-flash'}, 'quotaValue': '20'}]}, {'@type': 'type.googleapis.com/google.rpc.RetryInfo', 'retryDelay': '18s'}]}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\task\job.py", line 184, in run
File "videotrans\task\_translate_srt.py", line 45, in trans
File "videotrans\translator\__init__.py", line 933, in run
File "videotrans\translator\_base.py", line 79, in run
File "videotrans\translator\_base.py", line 96, in _run_text
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 439, in result
File "concurrent\futures\_base.py", line 391, in __get_result
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_gemini.py", line 131, in _item_task
videotrans.configure._except.StopRetry: You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/usage?tab=rate-limit.

  • Quota exceeded for metric: generativelanguage.googleapis.com/generate_content_free_tier_requests, limit: 20, model: gemini-2.5-flash
    Please retry in 18.449330921s.

TaskCfg(cache_folder=None, target_dir='C:/Ruanjian/win-pyvideotrans-v3.91/output/translate', remove_noise=False, is_separate=False, detect_language=None, subtitle_language=None, source_language=None, target_language=None, source_language_code='Japanese', target_language_code='Simplified Chinese', source_sub='C:/Users/liina/Videos/How to 学园 性爱教科书-1 (BARE-001)/_video_out/[email protected]', target_sub='C:/Ruanjian/win-pyvideotrans-v3.91/output/translate/[email protected] Chinese.srt', source_wav=None, source_wav_output=None, target_wav=None, target_wav_output=None, subtitles=None, novoice_mp4=None, noextname='hhd800.com@722BARE-001-ja', shibie_audio=None, targetdir_mp4=None, instrument=None, vocal=None, back_audio=None, background_music=None, app_mode='biaozhun', subtitle_type=0, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role=None, copysrt_rawvideo=False, clear_cache=False, translate_type=5, tts_type=None, recogn_type=None, model_name=None, split_type=0, voice_autorate=False, video_autorate=False, cuda=False, name='C:/Users/liina/Videos/How to 学园 性爱教科书-1 (BARE-001)/_video_out/[email protected]', basename='[email protected]', ext='srt', dirname='C:/Users/liina/Videos/How to 学园 性爱教科书-1 (BARE-001)/_video_out', shound_del_name=None, uuid='016077bac7', remove_silent_mid=False, align_sub_audio=True, enable_diariz=False, nums_diariz=0, rephrase=2, only_out_mp4=False)


=
system:Windows-10-10.0.26200-SP0
version:v3.91
frozen:True
language:zh
root_dir:C:/Ruanjian/win-pyvideotrans-v3.91

1 Replies

您遇到的错误是 Gemini AI 免费配额已用完。错误信息明确指出:Quota exceeded for metric: generativelanguage.googleapis.com/generate_content_free_tier_requests, limit: 20,即每个项目每天对 gemini-2.5-flash 模型的免费请求次数限制为 20 次,您已超出此限制。

核心解决方案:

  1. 更换翻译渠道:这是最快、最直接的解决方法。Gemini 免费配额有限,不适合翻译长视频字幕。请切换到其他翻译渠道,例如:

    • 免费渠道:Google 翻译(需配置代理)、DeepLX。
    • AI 大模型渠道:DeepSeek(免费额度高)、Claude、智谱AI、硅基流动等(需在软件“翻译设置”中配置相应的 API Key)。
  2. 等待配额重置:Gemini 的免费配额按天重置。您可以等待约 18 秒后重试(如错误提示),但更建议等待至第二天配额刷新后再使用。对于长视频,20 次的限额很容易用完。

操作步骤:

  1. 在 pyVideoTrans 主界面,点击“翻译设置”按钮。
  2. 在“翻译渠道”下拉菜单中,选择一个非 Gemini 的渠道。
  3. 如果您选择的是需要 API Key 的渠道(如 DeepSeek),请确保已在对应设置页面正确填写了 Key。
  4. 重新执行翻译任务。

预防措施:

  • 对于字幕翻译任务,如果字幕行数很多,建议在“高级选项” -> “字幕翻译调整”中,适当减小“每批字幕行数”,并勾选“批量翻译时强制串行”,以降低单次请求量,避免快速触发频率限制(虽然这无法解决 Gemini 的每日总配额问题)。
  • 长期使用建议申请并配置其他拥有更慷慨免费额度或按量付费的 AI 翻译 API。

请查看更多参考文档:

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

Similar issues already exist