Replies: 1 comment 1 reply
-
Hi. I am going through the same problem at the moment. Did you figure out any solution or alternate for this? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone!
When using
translate
withGoogleTranslator
I was getting an error, due to the limit of requests per day, so I started usingtranslate_batch
as suggested, but after some time I got the same exceptionTooManyRequests
. I found that if you're running the script to translate in your PC you can go to translate.google.com and there it will tell you that many suspicious calling were detected from your PC and they provide an option to make sure you're not a robot, you just click and that's it. But it turns out that when you're running the translation script from a server you don't have this option, but I found out that 30 minutes after you get this error you can run again and it will work until some point where the sameTooManyRequests
exception is thrown, and you wait for 30 minutes, and so on. I get the exception after less than 80 calls to thetranslate_batch
function, each of them with a 100-position list, each item of the list with apporximately 30 characters. So I guess the exception is thrown by number of characters not by number of calls.Anyway, I think it's good if this could be handled somehow by the library, what I did now was to put a delay of 30 minutes and 1 second when I get the exception, run again what didn't due to the exception and then continue running and it works well.
But, after some time I'm getting this exception:
TranslationNotFound
, which is weird because when I run again it finds the translation for that text, so I don't know if it's probably related with theTooManyRequests
exception. So I just proceed as before, setting a delay. But this time I'm not sure of how many minutes I must wait, as I just saw the console after many hours. If I find the approximate time I will update it.I wonder if it's better to create issues for this type of things, like, it will be more visible for people having the same problem, just adding some tag like
documentation
. Or if it's the case, to keep track and later implement something to avoid this kind of things.What do you think?
Thanks for reading.
Beta Was this translation helpful? Give feedback.
All reactions