lushan88a / google_trans_new

A free and unlimited python API for google translate.
MIT License
393 stars 170 forks source link

Too Many Requests #24

Open seonake opened 3 years ago

seonake commented 3 years ago

Hi, i am getting this message:

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

How can avoid this? Do I need to wait? How long? or Do I need to do something else? Many thanks.

lushan88a commented 3 years ago

Google recently restricted API use speed. You can change IP or use slowly.

petertadrous commented 3 years ago

I got the same message and I used the proxies feature in the google_translator() function but still getting the same message. How would I go about changing the IP? Everything I've read involves passing a different IP to some sort of request but I'm not sure how to do that with this module

raymond-edgerly commented 3 years ago

Anyone know what Google's rate limit is? 🙂 I think I hit it too hard 🔨😛

google_new_transError: 429 (Too Many Requests) from TTS API. Probable cause: Unknown

Googled "Text-to-Speech API rate limit", but it only seems it's per minute/request 🤔 https://cloud.google.com/text-to-speech/quotas

I reduced my request to an amount that previously worked - still 429'd.

From what I can tell, it seems to be on a per day basis with TTS API, but I'm uncertain what it might be 🤔🙂

jonas-nothnagel commented 3 years ago

I am running into the same issue. I used to employ the old google translator library and iterated it over hundreds of paragraphs. Anyone has found a solution? @lushan88a could you provide some instructions for this for the Python implementation?

jonas-nothnagel commented 3 years ago

@megaman110101 Did you find a solution for this in your work?

raymond-edgerly commented 3 years ago

@jonas-nothnagel the 429 error disappeared in less than 24 hours.

I just returned a successful request for 40,328 English characters into 3 languages (124,940 characters returned) - whitespace included.

The limit might actually be somewhere in the neighborhood of 6m. I'll keep track today and see if/when I hit the limit 🙂👍

Update: Returned another 620,346 off that original 40,328 (more languages beyond the initial 3). So far, a total of 745,286 characters return "ok" within a period of 1 hour.

Update2: Another 30 mins later I tried to run the original again for Vietnamese translation and received 429 error. Google let me reach 745,286 first, but gave me the error some time later. 🤷‍♂️🤔🙂

Update3: After about 10 hours, the limit reset, and I was able to query again 👍

jonas-nothnagel commented 3 years ago

@megaman110101 thank you for checking and logging :) I think my best shot is to submit the tasks in batches. Unfortunately my translation code is embedded in a long function that I would like to run once a week to get an updated dataset. I think I need to re-write this then. @lushan88a any solution in sight?

kanchansapkota27 commented 3 years ago

Any help please tried to translate a list of 1600 strings i.e around 147,171 character length. google_trans_new.google_trans_new.google_new_transError: 429 (Too Many Requests) from TTS API. Probable cause: Unknown

Romczyslaw commented 3 years ago

I tried to translate several hundred short lines of text and got the infamous 429 (shouldn't that raise an error?). The translated lines were in the list because I wanted to test a bulk translation. Maybe it is better to use a generator on a list with time.sleep(1) before yielding the translation function?