rany2 / edge-tts

Use Microsoft Edge's online text-to-speech service from Python WITHOUT needing Microsoft Edge or Windows or an API key
https://pypi.org/project/edge-tts/
GNU General Public License v3.0
5.45k stars 556 forks source link

Limits on the TRUSTED_CLIENT_TOKEN #21

Closed cmalzatet closed 1 year ago

cmalzatet commented 1 year ago

Hi! I would like to ask if there is a limit to the TRUSTED_CLIENT_TOKEN used in the library, like number of synthesis or somethign like that.

Thank you for your help.

rany2 commented 1 year ago

TRUSTED_CLIENT_TOKEN is the same as the one used in the Microsoft Edge browser, so there shouldn't be any noticeable limits if you're using it normally. The only limit with the API I was able to find is that it starts returning 429 if you flood it with 500 connections in parallel, but if you stay moderate about your # of connections and have some cooldown time between bursts then it would be fine.

Any 429 block is temporary and goes away in 5 minutes.

rany2 commented 1 year ago

Also you can't use any of the Azure Cognitive Services features anymore (unless they are also accessible in Microsoft Edge), so for example expression/emotion, background audio, other MS SSML additions are not possible. They had blocked them a while ago, though there might be some workaround; not that I'm keen on finding it, seems like a pointless cat and mouse game.

NimayDono commented 1 year ago

Hi! I would like to ask if there is a limit to the TRUSTED_CLIENT_TOKEN used in the library, like number of synthesis or somethign like that.

Thank you for your help.

Tested on 2495 consecutive short requests. One error on 416. Reliable enough.

lucasjinreal commented 1 year ago

@rany2 what could happen if I run it synethsis 2 days with every sentence 1s break?

rany2 commented 1 year ago

@lucasjinreal I don't know, did you end up doing this?