#3475 openai.PermissionDeniedError: Your request was blocked.

2a02:6ea0* Posted at: 4 hours ago 👁14

当前密钥没有访问权限,请检查权限设置 Your request was blocked.:Traceback (most recent call last):
File "videotrans\util\TestSrtTrans.py", line 19, in run
File "videotrans\translator\__init__.py", line 975, in run
File "videotrans\translator\_base.py", line 101, in run
File "videotrans\translator\_base.py", line 164, 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\_chatgpt.py", line 136, in _item_task
File "openai\_utils\_utils.py", line 286, in wrapper
File "openai\resources\chat\completions\completions.py", line 1192, in create
File "openai\_base_client.py", line 1297, in post
File "openai\_base_client.py", line 1070, in request
openai.PermissionDeniedError: Your request was blocked.


=
system:Windows-10-10.0.26200-SP0
version:v3.97
frozen:True
language:zh
root_dir:D:/SOFTWARES/Videotrans

5 Replies

这是由于你使用的AI翻译渠道(OpenAI或兼容接口)的API密钥(Key)没有访问权限或被服务商阻止。

解决方案:

  1. 检查API密钥:确认你填写的API Key是否正确、是否已过期、或是否绑定了正确的模型服务。例如,DeepSeek的Key不能用于OpenAI官方接口。
  2. 检查API URL:确认你填写的API URL是否与你使用的服务商匹配。例如,使用DeepSeek应填写 https://api.deepseek.com
  3. 检查模型名称:确认在翻译渠道设置中手动输入的“模型”名称是否正确。例如,使用DeepSeek应填写 deepseek-chat
  4. 检查账户状态:登录对应AI服务商的控制台,确认账户是否有余额、是否被风控、或该Key是否拥有调用对应模型的权限。
  5. 切换翻译渠道:如果问题持续,可以暂时切换到其他翻译渠道(如Google翻译、DeepL等)进行测试,以排除是当前渠道服务本身的问题。

请查阅相关文档:

想通的api key在任何其他客户端都正常运行着!

这表明你的API Key本身有效,但pyVideoTrans的请求被服务商(如OpenAI、DeepSeek等)的接口规则或风控策略阻止。常见原因是请求频率过高、并发数过多,或请求格式不符合服务商要求。

解决方案:

  1. 降低请求频率:在软件顶部菜单 -> “工具/选项” -> “高级选项” -> “字幕翻译调整”区域,将“翻译后暂停秒”设置为一个较大的值(例如5-10秒)。
  2. 减少并发请求:在同一“高级选项”区域,将“AI翻译渠道每批字幕行数”设置为一个较小的值(例如5-10行)。
  3. 检查请求格式

    • 如果你使用的是OpenAI兼容接口(如DeepSeek),请确认在翻译渠道设置中,“模型”名称填写正确(例如 deepseek-chat)。
    • 尝试取消勾选“发送完整字幕”选项(如果当前已勾选),改为按行翻译。
  4. 检查网络环境:如果服务商对IP地址有区域限制,请确保你的网络环境(包括代理)符合要求。可以在“设置”->“网络代理”中配置。
  5. 查看服务商文档:访问你所用API服务商的官方文档,确认其接口调用限制(如RPM/TPM限制),并确保你的使用方式未超出限制。

如果以上步骤无法解决,请提供软件安装目录下 logs/ 文件夹中最新日志文件的底部约30行内容,以便进一步分析。

请查阅相关文档:

这是完整的log文件。你可以看下:


Application started at 2026-03-05 17:12:12

First searching GPU...
[DEBUG] 平台: Windows。正在按优先级检测最佳的 'h264' 编码器: ['nvenc', 'qsv', 'amf']
[DEBUG] 正在测试编码器是否可用: h264_nvenc...
Found 1 GPUs, cost=1s
start workers...
process_max_gpu=0
multi_gpus=False
Concurrent task_nums=1
process_max=0
start 8 jobs
ended workers
[DEBUG] 硬件编码器 'h264_nvenc' 可用。
[DEBUG] 已选择硬件编码器: h264_nvenc
[DEBUG] 最终确定使用的编码器: h264_nvenc
[DEBUG] 平台: Windows。正在按优先级检测最佳的 'hevc' 编码器: ['nvenc', 'qsv', 'amf']
[DEBUG] 正在测试编码器是否可用: hevc_nvenc...
[DEBUG] 硬件编码器 'hevc_nvenc' 可用。
[DEBUG] 已选择硬件编码器: hevc_nvenc
[DEBUG] 最终确定使用的编码器: hevc_nvenc
[INFO] Starting call to 'videotrans.translator._chatgpt.ChatGPT._item_task', this is the 1st time calling it.
[DEBUG]
[chatGPT]发送请求数据:message=[{'role': 'system', 'content': 'You are a top-tier Subtitle Translation Engine.'}, {'role': 'user', 'content': '# Role\nYou are an expert subtitle translator and SRT formatting specialist.\nYour Goal: Translate
......
itle translator and SRT formatting specialist.\nYour Goal: Translate the SRT subtitle batch in into English.\nYour Core Principle: **Strict Structural Adherence + Natural Spoken Language.**\n\n# INPUT DATA\n[Global Context]: See (if provided). Use this ONLY for understanding plot/terms. DO NOT translate it.\n[Target Batch]: See . This is the ONLY text you must translate and output.\n\n# CRITICAL FORMATTING RULES (Non-Negotiable)\n1. **Absolute 1-to-1 Mapping**:\n - Count the input blocks. The output MUST have the EXACT same number of blocks.\n - If input has 32 blocks, output MUST have 32 blocks.\n2. **Immutable Metadata**:\n - Copy Index Numbers (1, 2, 3...) exactly.\n - Copy Timestamps (00:00:00,000 --> ...) exactly.\n - Preserve the exact blank line structure between blocks.\n3. **Segmentation Logic (Crucial)**:\n - **Do NOT merge lines**: If a sentence spans across Block A and Block B in the source, the translation MUST also span across Block A and Block B.\n - **Do NOT split lines**: Never create new blocks.\n - **Fragment Mapping**: If a source line is a sentence fragment (e.g., "I went to..."), translate it as a corresponding fragment in English that flows logically into the next line. Do not force it into a complete sentence if that destroys the flow with the next block.\n4. **Safety & Fallback**:\n - Never output empty text. If a line is untranslatable (sound effects, symbols), keep the original text or a standardized equivalent in English.\n - Do not include tags, font codes, or brackets like (music) unless they exist in the source.\n\n# TRANSLATION STYLE GUIDELINES\n1. Natural & Conversational: Use the target language\'s spoken logic. Avoid "Translationese" or stiff formal grammar.\n2. Concise: Subtitles must be readable quickly. Choose shorter synonyms if they convey the same meaning/emotion.\n3. Contextual Flow: Ensure the translation fits the Global Context (gender, tone, plot) but stays strictly within the time-bound limitations of the specific batch.\n\n\n\n\n\n# OUTPUT FORMAT\nReturn the result inside `` tags.\n\nExample of "Fragment Mapping" Logic:\nSource Input:\n1\n00:01:00,000 --> 00:01:02,000\nI decided to go\n\n2\n00:01:02,500 --> 00:01:04,000\nto the supermarket.\n\nWrong Output (Merged/Fixed):\n1\n...\n[Translated "I decided to go to the supermarket."]\n2\n...\n[Empty or Repeated]\n\nCorrect Output (Mapped):\n1\n...\n[Translated "I decided to go" fragment]\n2\n...\n[Translated "to the supermarket." fragment]\n\n
\n\n# Actual Task\nTranslate the following batch into English:\n\n\n1\n00:00:00,000 --> 00:00:05,000\n你好啊我的朋友\n'}]
[DEBUG] [字幕翻译]渠道3,gemini-3-pro-preview:共耗时:0s
等待 uuid_signal 线程退出
正在等待线程 PrepareVideo 结束...
正在等待线程 SpeechToText 结束...
正在等待线程 DiarizSpeaker 结束...
正在等待线程 TranslationSRT 结束...
正在等待线程 DubbingSrt 结束...
正在等待线程 AlignVieoAudioSrt 结束...
正在等待线程 AssembVideoAudioSrt 结束...
正在等待线程 TaskDone 结束...
Successfully killed ffmpeg processes using taskkill

根据日志分析,问题核心是 AI翻译渠道(OpenAI/兼容接口)的请求被服务商(很可能是DeepSeek)的接口风控策略阻止。日志显示请求已成功发送([DEBUG] [chatGPT]发送请求数据),但随后立即报错“Your request was blocked.”。由于你的API Key在其他客户端正常,这表明pyVideoTrans的请求模式(如并发、频率、请求体格式)触发了服务商的安全限制。

解决方案:

  1. 立即降低请求频率与并发

    • 进入软件顶部菜单 -> “工具/选项” -> “高级选项” -> “字幕翻译调整”区域。
    • “翻译后暂停秒” 设置为 10 或更高。
    • “AI翻译渠道每批字幕行数” 设置为 1(最保守),或一个较小的值(如5)。
  2. 调整请求格式

    • 在翻译渠道的设置面板中,取消勾选“发送完整字幕” 选项。这会将请求从发送完整的SRT格式(包含时间轴和大量上下文)改为仅发送纯文本行,请求体更小,更符合常规API调用模式,可能绕过风控。
  3. 检查并修正模型名称

    • 确认你在翻译渠道设置中手动输入的 “模型”名称 完全正确。例如,对于DeepSeek,应填写 deepseek-chatdeepseek-chat-001(根据你的账户权限)。错误的模型名称也可能导致权限错误。
  4. 切换翻译渠道进行测试

    • 暂时切换到其他翻译渠道(如“Google翻译”或“DeepL”)。如果其他渠道工作正常,则进一步确认是当前AI渠道的配置或风控问题。
  5. 检查网络代理

    • 如果你的API服务商对区域有要求,确保网络环境正确。可以在“设置”->“网络代理”中配置代理。

如果以上步骤均无效,可能是服务商对来自pyVideoTrans的特定User-Agent或请求头进行了限制。此时,建议:

  • 联系你使用的API服务商(如DeepSeek)的客服,说明情况,询问是否有针对此类客户端或请求模式的限制。
  • 或者,暂时使用其他翻译渠道完成当前任务。

请查阅相关文档:

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