Skip to content

About Error: Unexpected server response: 403 #2

@drawcall

Description

@drawcall

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: rany2/edge-tts#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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions