#8249 :Traceback (most recent call last): File

2605**d4d Posted at: 1 hour ago

请问deepl无法使用是什么原因
:Traceback (most recent call last):
File "videotrans\translator\_base.py", line 79, in run
File "videotrans\translator\_base.py", line 117, 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 421, in exc_check
tenacity.RetryError: RetryError[]

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 71, in run
File "videotrans\translator\_base.py", line 85, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_deepl.py", line 40, in _item_task
File "deepl\translator.py", line 446, in translate_text
File "deepl\translator.py", line 233, in _raise_for_status
deepl.exceptions.DeepLException: Unexpected status code: 405 Method Not Allowed, content:

MethodNotAllowed
The specified method is not allowed against this resource.
/
NmFkNDVhYmFfOTRhZjI0MDlfMTU0MjhfMTFhMDllMzY=
OGVmYzZiMmQzYjA2OWNhODk0NTRkMTBiOWVmMDAxODc1NGE1MWY0MzY2NTg1MzM1OTY3MDliYzY2YTQ0ZThhMDEyMDU4N2M2MDc1YzAwMmE2ODgyYzQxMjQzMTczYjQz

.


=
system:Windows-10-10.0.22000-SP0
version:v4.16
frozen:True
language:zh_CN
root_dir:D:/翻译

1 Replies

#1 DeepSeek reply at 1 hour ago

核心原因:请求虽然发出去了,但 DeepL 服务端拒绝了该请求的请求方法(405),并且返回的是 XML 格式的网关/资源类错误,而不是 DeepL API 正常的 JSON 错误。这说明请求没有打到正确的 DeepL 翻译接口端点,通常是因为 API 地址填写有误使用了中转地址或代理拦截,而不是翻译内容或语言代码问题。

排查与解决步骤:

  1. 检查 菜单 → 翻译设置 → DeepL 中的 API 地址:

    • 官方付费版密钥填 https://api.deepl.com/v2/
    • 免费版密钥(通常以 :fx 结尾)必须填 https://api-free.deepl.com/v2/
    • 不要填写 https://www.deepl.com、网页版地址、带 /translator 之类路径的地址,也不要多写斜杠或空格。
  2. 检查密钥:确认密钥完整、无前后空格、未过期、账户已开通 API 服务(DeepL API 需绑定国际信用卡开通,注册普通网页账号不等于开通 API)。
  3. 若使用了中转/代理服务:确认该中转地址真实支持 POST /v2/translate。405 常见于中转地址填错或服务端不提供该接口。
  4. 清空主界面右侧的代理文本框后重试(填写无效代理会导致请求被错误转发)。
  5. 恢复默认配置验证:删除 videotrans/params.json 会清空已填密钥,请先备份,再重新填写 DeepL 密钥测试。

若以上均确认无误仍报 405,请提供 logs/ 目录下最新日志底部约 30 行(含实际请求地址)以便进一步定位。

请查阅相关文档:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
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