-
Notifications
You must be signed in to change notification settings - Fork 365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
503 Server Error: Service Unavailable #14
Comments
It looks like Google is blocking my requests. |
Sorry for the delay, yes this is one of the main drawbacks of this library: it uses a free unrestricted API. Google will automatically block requests (on the Web, ask for a captcha) for a period of time when overused (in general). Pierre Nick Durette
|
Actually, will leave this open so it's easier to find, unless I had it to the README.md. |
I believe google added a hash to the request. If the provided hash value in the request does not match the hash value of the content, then they will return an error. Google pretty much sealed the deal on this. However, you can easily switch from using google TTS to Bing TTS by making a few simple tweeks in the url. Replacing the original save function in tts.py with whats below should work (at least for zh-cn) with the Bing TTS.
Also if you want to improve performance on this, you need to pack as much content into a single URL as possible by combining parts together while not exceeding the limit. However if you insist on using google's TTS, you have to install the google TTS (https://play.google.com/store/apps/details?id=com.google.android.tts&hl=en) onto an android device or AVD, then write an app that uses the API to takes in text and synthesize an audio file to be sent back over wifi. |
Thanks @fruitpunch! It was only a matter of time till Google locks this down more... Thanks for the Bing suggestion/TTS call url, that would sure be a good replacement (until Microsoft locks it down as well..). I will take a look! That could be a good substitute. |
Fixed in #17, updated gTTS to 1.1.2. |
Even after the fix it may be worth mentioning google will be quicker with its 503s after a couple of 403s then during normal service. However I suppose spamming enough will still get you 503-ed. |
Yes, true. I wanted to clarify this in the changelog (wrote it late and in a hurry). The 503s will most likely still happen from time to time, that check/blacklisting happens at different level (upstream) for all Google services AFAIK.
|
Did you find the algorithm to calculate the token by looking through the javascript on the google translate page? |
@Boudewijn26 did yes. It's all inline (and obfuscated) on translate.google.com |
I tried
gtts-cli.py "Hello" -l 'en' -o hello.mp3
and I get the following error
503 Server Error: Service Unavailable
The text was updated successfully, but these errors were encountered: