#1143 requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.moonshot.cn/v1/chat/completions/?target_

130.51* Posted at: 7 days ago 👁35

404 Client Error: Not Found for url: https://api.moonshot.cn/v1/chat/completions/?target_language=en&source_language=zh&text=%E4%BD%A0%E5%A5%BD%E5%95%8A%E6%88%91%E7%9A%84%E6%9C%8B%E5%8F%8B&secret=sk-IxF8EqARHjokEN86FlAk3OGH2qdh7TQrI5AHi6zqmkmetlbS:Traceback (most recent call last):
File "videotrans\translator\_base.py", line 81, in run
File "videotrans\translator\_base.py", line 99, 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\__init__.py", line 875, in run
File "videotrans\translator\_base.py", line 83, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_transapi.py", line 42, in _item_task
File "requests\models.py", line 1026, in raise_for_status
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.moonshot.cn/v1/chat/completions/?target_language=en&source_language=zh&text=%E4%BD%A0%E5%A5%BD%E5%95%8A%E6%88%91%E7%9A%84%E6%9C%8B%E5%8F%8B&secret=sk-IxF8EqARHjokEN86FlAk3OGH2qdh7TQrI5AHi6zqmkmetlbS


=
Windows-10-10.0.19045-SP0
version:v3.81
frozen:True
language:zh

1 Replies

这个错误是由于 Moonshot (月之暗面) API 调用失败导致的 404 错误。从错误信息可以看出,请求的 URL 格式不正确。

问题原因:
Moonshot API 的请求 URL 格式错误。正确的 API 端点应该是 https://api.moonshot.cn/v1/chat/completions,但当前请求将参数直接拼接在了 URL 中。

解决方案:

  1. 检查 API 密钥配置:

    • 在菜单栏选择 翻译设置
    • 找到 Moonshot 翻译渠道
    • 确保 API 密钥格式正确且有效
  2. 重新配置 Moonshot 设置:

    • 如果问题持续,建议删除当前的 Moonshot 配置
    • 重新添加 Moonshot 翻译渠道
    • 确保只填写 API 密钥,不要修改其他参数
  3. 临时解决方案:

    • 切换到其他翻译渠道,如 Google、Microsoft 或 DeepSeek
    • 这些渠道通常更稳定且配置简单
  4. 检查网络连接:

    • 确保网络可以正常访问 api.moonshot.cn
    • 如有需要,可在翻译设置中配置网络代理

如果问题依旧存在,请提供完整的日志文件(位于 videotrans/logs/ 目录下)以便进一步分析。

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.

Donate: https://ko-fi.com/jianchang512

Similar issues already exist

Trending Questions