py-googletrans: error in googletrans 4.0.0rc1 translator
I tried the new version of googletrans 4.0.0rc1.
translator = Translator(service_urls=['translate.google.com'])
res = translator.translate(text)
After some time an exception occurs:
AttributeError: 'Translator' object has no attribute 'raise_Exception'
To fix this I need to execute this line:
translator.raise_Exception = True
And then the exception writes: Exception: Unexpected status code "429" from ['translate.google.com']
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 13
- Comments: 19
Wanted to comment so other people don’t have to perform another search: currently google translate API allows 5 calls/second, caps it at 200k a day
Hi, I just used time.sleep(1) in translation loop. It gives more coffee time, works for me.
Not a solution for this issue, but perhaps still helpful. I ended up using transformer based Neural Translation https://github.com/UKPLab/EasyNMT
It takes more time, but since it is a pre-trained model it is not dependent on some API we have no control over and the translation quality is fantastic.
Same happened to me as well when executing the code snippet below:
Hi! Did time.sleep() work to anyone to make “infinite” requests to the google translate API?
sleep(0.3)
Hello there, error 429 (Too Many Requests) it is a problem between your external IP and google. Just restart the Modem to change the IP.
Ok, not effective at all.