bregydoc / gtranslate

Google translate API for unlimited and free translations, gtranslate generates the necessary token to use the Google Translate API for free

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"429 too many requests " response for http.Get(u.String())

Andystark opened this issue · comments

hang in loop http.Get(u.String()) , how to avoid this 429 httpCode error?
死循环在调谷歌api 里了,谁知道怎么避免这个 429 too many requests 么

==============
My IP was blocked by Google ..... I changed an IP to avoid this problem
But DEAD LOOP will happen in these code if t.StatusCode == 429
for tries > 0 {
...
if r.StatusCode == http.StatusForbidden {
tries--
time.Sleep(delay)
}