#8893 自定义TTS API: {

2409**42fa Posted at: 11 hours ago

自定义TTS API: {"detail":"Method Not Allowed"}
{'text': '你好啊,我亲爱的朋友,希望你的每一天都是美好愉快的!', 'role': '', 'filename': 'E:/AI/win-pyvideotrans-v4.19/tmp/28552/1795338374.0274293-ttsapi.wav', 'tts_type': 36}
Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 23, in run
File "videotrans\tts\__init__.py", line 154, in run
File "videotrans\tts\_base.py", line 98, in run
File "videotrans\tts\_base.py", line 201, in _exec
File "videotrans\tts\_base.py", line 161, in _local_mul_thread
File "videotrans\tts\_base.py", line 216, in _item_task
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\tts\_ttsapi.py", line 77, in _run
videotrans.configure.excepts.StopTask: {"detail":"Method Not Allowed"}


=
system:Windows-10-10.0.26200-SP0
version:v4.19
frozen:True
language:zh_CN
root_dir:E:/AI/win-pyvideotrans-v4.19

1 Replies

#1 DeepSeek reply at 11 hours ago

This error is not caused by pyVideoTrans: {"detail":"Method Not Allowed"} is an HTTP 405 response returned by your own TTS service: pyVideoTrans sent a POST request to the API URL you entered, but the route at that address does not accept POST (or that path does not exist at all, so the server only exposes other methods).

Handling steps:

  1. Check the API URL you entered in Menu → TTS Settings → Custom TTS API: it must be the actual synthesis endpoint (for example http://127.0.0.1:9880/tts), not the service root address, not the WebUI address, and not the /docs address.
  2. Test the address directly with curl (replace it with your own address and the fields your service requires):
    curl -X POST "http://127.0.0.1:端口/路径" -H "Content-Type: application/json" -d "{...}"
    If 405 still occurs here, it is confirmed that your service does not support POST at that path.
  3. Check the route definitions of your TTS service (@app.post(...) / app.route(..., methods=["POST"])); if it provides only GET, or the path is different (for example /api/tts), correct the URL or add the POST route on the server side.
  4. Do not fill in 0.0.0.0; use 127.0.0.1. Also make sure the service is already running and the port is correct.
  5. In addition to the route, the response must also return audio data in the format required by the software; otherwise the next error will still occur.

No relevant records were found in the knowledge base for the specific request body format of the custom TTS channel, so it cannot be further determined; if the route has been confirmed to be correct and the error persists, please provide the error information from your service-side log and from logs/ in the software directory.

Please refer to the related documentation:

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