-
Notifications
You must be signed in to change notification settings - Fork 37
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
Always getting 403 error #22
Comments
好像是限制4秒一次请求 |
感觉没用几次就 403 了 |
Duplicates to matheuss/google-translate-api#79. |
@hua1995116 |
I set client with "t" or "webapp" , but also got 403.... |
What about using |
Unfortunately, it also doesn't work. |
Got the same issue |
same problem |
碰到同样问题, 有解决方法么? |
The same issue, is there any solution? |
It seems that Google has changed the way it generates tokens for bulk generation, and no good alternative has been found yet. |
Hope it will be resolved soon 😕 |
升级到 1.3.7,依然 403🥵 |
still 403 here! :( |
@hua1995116 take a look here vitalets/google-translate-api#61 |
use client: "dict-chrome-ex" resolved the problem |
This does not work. Is there a solution? |
client: "dict-chrome-ex" works, but input should not be long // const {Translate} = require('@google-cloud/translate').v2;
// const translate = new Translate({projectId: "annular-form-299211"});
const cache_path = 'google_translate_cache.json'
let google_translate_cache = {}
try { google_translate_cache = JSON.parse(fs.readFileSync(cache_path).toString()) } catch (e) { }
async function google_translate_with_cache(input, { from, to }) {
const cache_key = [from, to].filter(x => x).join('|')
if (!google_translate_cache[cache_key]) { google_translate_cache[cache_key] = {} }
const google_translate_cache_to = google_translate_cache[cache_key]
const x = google_translate_cache_to[input]
if (x) { return x }
// const translation = await translate(input, { from, to })
// let translation_ = translation.data[0]
const response = await require('google-translate-open-api').default(input, { from, to, client: "dict-chrome-ex" })
let translation_ = response.data.sentences.map(x => x.trans).join('')
google_translate_cache_to[input] = translation_
return translation_
}
function google_translate_sync() {
fs.writeFileSync(cache_path, JSON.stringify(google_translate_cache))
} |
You get 403 because of Google's CORS policy. |
Hello
It seems that almost all request end up with error code 403.
The text was updated successfully, but these errors were encountered: