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
why i am getting 503? #67
Comments
I am seeing similar issues today; used to work fine, but now after a few requests, i am getting a 'Bad Request' error, and when debugging more, i see that it's rate limiting |
@hdatteln please let me know if you have found anything alternative? Do you have any idea so far? |
I added a few logging statements and then saw a 'Our systems have detected unusual traffic from your computer network;' & a reCaptcha check as a response message to the google api call that this google-translate-api module makes. |
Hey did you find any solution for this? |
i am using a python version, it works fine on the same server. The generated token is same, url params and generated Url is also almost same. def build_params(query, src, dest, token):
params = {
'client': 't',
'sl': src,
'tl': dest,
'hl': dest,
'dt': ['at', 'bd', 'ex', 'ld', 'md', 'qca', 'rw', 'rm', 'ss', 't'],
'ie': 'UTF-8',
'oe': 'UTF-8',
'otf': 1,
'ssel': 0,
'tsel': 0,
'tk': token,
'q': query,
}
print(params)
return params and this node version var url = "https://translate.google.com/translate_a/single";
var data = {
client: "t",
sl: opts.from,
tl: opts.to,
hl: opts.to,
dt: ["at", "bd", "ex", "ld", "md", "qca", "rw", "rm", "ss", "t"],
ie: "UTF-8",
oe: "UTF-8",
otf: 1,
ssel: 0,
tsel: 0,
kc: 7,
q: text
};
data[token.name] = token.value;
console.log(data);
return url + "?" + querystring.stringify(data); How can python one works when the nodejs can't? Any idea? |
@iamanam can you show the result of the complete request, headers and all? |
@0xdeade1f here is the headers and url from python version response header: {'Connection': 'keep-alive', 'Cookie': 'NID=130=B2U7oyM_HaGncf7MM1FVZ6yFIiiByM12hCnSm5KkdCm1JKHGbOt-dI6w9yBAl7MXQWw_dRwtlHBv4mgkp5531p_TcPhEwQ91dzk0O4CKL4PEDD-pPLmK9qm_Y3TPlKni', 'Accept-Encoding': 'gzip, deflate', 'Accept': '/', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)'} Request header: {'X-XSS-Protection': '1; mode=block', 'Content-Disposition': 'attachment; filename="f.txt"', 'X-Content-Type-Options': 'nosniff', 'Transfer-Encoding': 'chunked', 'Accept-Ranges': 'none', 'Expires': 'Fri, 01 Jan 1990 00:00:00 GMT', 'Vary': 'Accept-Encoding', 'Server': 'HTTP server (unknown)', 'Pragma': 'no-cache', 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Date': 'Wed, 23 May 2018 22:36:31 GMT', 'X-Frame-Options': 'SAMEORIGIN', 'Alt-Svc': 'hq=":443"; ma=2592000; quic=51303433; quic=51303432; quic=51303431; quic=51303339; quic=51303335,quic=":443"; ma=2592000; v="43,42,41,39,35"', 'Content-Type': 'application/json; charset=UTF-8'} Url: |
This is a warning that Google is cracking down on this repo and many others that are similar. In case you have not noticed, it uses a token hack to generate a unique token every hour, this is likely to be illegal and could get you in trouble. Do not use this for production projects - you can see for yourself here: |
It works only for first few requests. After many requests it rejects and shows 503 Error. Did they implement any rate limiting?
Please check it out.
{ HTTPError: Response code 503 (Service Unavailable)
at stream.catch.then.data (/index.js:123:13)
at
at process._tickCallback (internal/process/next_tick.js:160:7)
..................
The text was updated successfully, but these errors were encountered: