Comments (21)
Can you give some details on how you're using it or what exactly you're doing?
from google-translate.
It happens randomly 30%-50% of tries.
from google-translate.
Why are you directly making the HTTP request instead of using the library?
from google-translate.
Why are you directly making the HTTP request instead of using the library?
To provide details for the issue
from google-translate.
@k3rn31p4nic This happens even when I use the library. The error is not consistent. It returns 403 and when you keep retrying, it then works
from google-translate.
Can you say what you're translating and the source and target language? I'm not able to reproduce this issue.
from google-translate.
translate('Bot fix time',{to:'yo'});
translate('Bot fix time',{from:'en' to:'es'});
translate('Bot fix time',{to:'spanish'});
That is just one example out of multiple. Every request I try regardless of the query or language gives that error. After retrying about once to four times, it works and then repeats again.
from google-translate.
Okay, I'm getting the same error now. From what I can observer, you'll get this error if you continuously make the request without enough delay (I need confirmation from others too).
If that's the case, I suppose this is a rate limit enforced by Google in their online translate service to prevent users like us from using it for purposes like this, for free, instead of using their actual Translate API.
from google-translate.
Funny enough it happens even on first tries. Unless by delay you mean it tracks request coming from this library?
from google-translate.
No, I meant from the same IP.
from google-translate.
Then, I doubt it is a delay issue. You can give it some more tries to confirm.
from google-translate.
Probably have to update the token generator.
https://github.com/k3rn31p4nic/google-translate-api/blob/411112851b27c6bd5698f6344a65f367e5dbc87a/src/tokenGenerator.js#L2-L5
from google-translate.
I have a similar feeling.
from google-translate.
It doesn't depend on delay. Even first try can return 403. Potentially is a token generator issue.
from google-translate.
Any update on this @k3rn31p4nic ?
from google-translate.
How about making request through proxy? // edit: it is just a quick guess
from google-translate.
@Andrey-Pavlov I don't think so, it isn't related to token, everything works on localhost, seems google is blocking IP which makes a lot of request.
Yes, adding proxy support would be great.
Upd: If I keep retrying it works
from google-translate.
#8 Check this PR, I didn't found any working proxies yet. But it should work
from google-translate.
Should be fixed by #8 or at least less chances of being blocked.
from google-translate.
@k3rn31p4nic Seems google changed API, they are migrating to new API. I think after migration we can't use at all.
from google-translate.
Checkout this #8 (comment), should work
from google-translate.
Related Issues (20)
- Bug in the return of the translation
- please make it support chinese. HOT 1
- [HTTP Error] Is there a maximum amout of translations? HOT 8
- package doesnt work on heroku project HOT 2
- didn't work behind proxy
- HTTP Error HOT 5
- Failed to compile under node.js 16.14.0 HOT 1
- Is anyone getting more of the HTTPError from the past few days?
- When I try to translate "says goooo" and "Naguará me moría", I get TypeError HOT 1
- migrate from got library to undici
- Version 2.0 with the breaking change Node > 16.0 HOT 1
- Support Languages HOT 2
- Version 2.0.0 error: SyntaxError Unexpected token '<', \"<html lang\
- When translate long text. The version 2.0.0 give SyntaxError: Unexpected token '<', \"<html lang\"... is not valid JSON HOT 3
- Could not run the application after installing, throwing an error mentioned below HOT 4
- tokenGenerator.js async function updateTKK() is outdated HOT 2
- caught SyntaxError: Cannot use import statement outside a module HOT 1
- SyntaxError: Unexpected token < in JSON at position 0 HOT 1
- Can we have a java library for this please ? HOT 1
- Link broken
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-translate.