FFAIVideo
FFAIVideo copied to clipboard
About Error: Unexpected server response: 403
When using edge-tts, a 403 error was encountered, which may be due to the server rejecting the request. The error message is as follows:
_url: 'wss://speech.platform.bing.com/consumer/speech/synthesize/readaloud/edge/v1?TrustedClientToken=6A5AA1D4EAFF4E9FB37E23D68491D6F4',
_req: ClientRequest {
_events: [Object: null prototype],
_eventsCount: 4,
_maxListeners: undefined,
...
}
[Symbol(kType)]: 'error',
[Symbol(kError)]: Error: Unexpected server response: 403
This issue has been discussed on GitHub: https://github.com/rany2/edge-tts/issues/290
The solution is to use ttsProxy to configure a proxy. You can add the following to your configuration:
termsNum: 8,
subtitleMaxWidth: 9,
videoClipDuration: 10,
ttsProxy: 'http://127.0.0.1:1080',
By configuring a proxy, you can bypass the server's restrictions and successfully access the TTS service.