#3952 requests.exceptions.HTTPError: 405 Client Error: Method Not Allowed for url: http://127.0.0.1:7860/

2409:8a0c* Posted at: 7 hours ago 👁11

405 Client Error: Method Not Allowed for url: http://127.0.0.1:7860/:
Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 16, in run
File "videotrans\tts\__init__.py", line 386, in run
File "videotrans\tts\_base.py", line 181, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\tts\_ttsapi.py", line 58, in _run
File "videotrans\tts\_ttsapi.py", line 102, in _apirequests
File "requests\models.py", line 1026, in raise_for_status
requests.exceptions.HTTPError: 405 Client Error: Method Not Allowed for url: http://127.0.0.1:7860/


=
system:Windows-10-10.0.19045-SP0
version:v3.98
frozen:True
language:zh
root_dir:D:/win-pyvideotrans-v3.98-0406

1 Replies

这是由于配置的 TTS API 地址不正确或服务未正确启动导致的。405 错误表示服务器拒绝了请求方法,通常是因为你配置的地址指向了错误的端点(例如,指向了 WebUI 的根路径,而非 API 路径)。

解决方案:

  1. 确认 TTS 服务已正确启动:确保你部署的 F5-TTS、CosyVoice 或 ChatterBox 等 TTS 服务正在运行,并且终端窗口没有关闭。
  2. 检查并修正 API 地址:在 pyVideoTrans 的 菜单 -> 配音设置 -> F5-TTS(或其他对应 TTS 渠道)的设置面板中,检查 API 地址。

    • F5-TTS 的默认 API 地址通常是 http://127.0.0.1:7860/api/tts
    • CosyVoice 的默认 API 地址通常是 http://127.0.0.1:7860/api/ttshttp://127.0.0.1:7860/tts
    • ChatterBox 的默认 API 地址通常是 http://127.0.0.1:9880/v1/audio/speech
    • 请务必使用服务提供的 API 端点,而不是 WebUI 的首页地址(http://127.0.0.1:7860/)。
  3. 测试连接:在浏览器中访问你配置的完整 API 地址(例如 http://127.0.0.1:7860/api/tts),查看是否能正常响应(可能会返回错误信息,但不应是 405 错误)。如果无法访问,说明服务未启动或地址有误。
  4. 重启软件:修正 API 地址后,重启 pyVideoTrans 再试。

请查阅相关文档:

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