pythongtts

gtts.tts.gTTSError: 429 (Too Many Requests) from TTS API. Probable cause: Unknown


I've installed GTTS using pip with python and the first copule of iterations seemes fine. However now I keep getting this error:

gtts.tts.gTTSError: 429 (Too Many Requests) from TTS API. Probable cause: Unknown

I've removed it from a loop but it stil wont run, here is my code:

audio = gTTS(text="Hello World", lang='en', slow=False)
audio.save("audio.mp3")

How do i fix this, I've uninstalled, and waited for about an hour but Its not fixed. I've researched and all of the solutions are saying its an anti DDOS filter but I've waited and the error doesn't show any indication to this.


Solution

  • You may be blocked for longer than an hour. I would suggest waiting for longer, such as a day. After that if it works, then you can try to introduce an artificial wait by using time.sleep(10) before each request, which would pause program execution for 10 seconds. This way might help you to avoid being rate limited.