Git Product home page Git Product logo

Comments (8)

iamtraction avatar iamtraction commented on June 23, 2024 1

Do you know how often you can make requests without errors?

Nope. As this isn't an official API, we don't know about their rate limits.

from google-translate.

iamtraction avatar iamtraction commented on June 23, 2024

Are you still getting the error?

from google-translate.

cheesits456 avatar cheesits456 commented on June 23, 2024

I ran into the same issue while using this for a live translator that I implemented into my Discord bot
image

from google-translate.

iamtraction avatar iamtraction commented on June 23, 2024

Can you give a minimal reproducible example?

from google-translate.

kalpak44 avatar kalpak44 commented on June 23, 2024

I did not watch the implementation, but the requests themselves towards Google translator are banned with frequent use. The first several times is ok, after several times start to throw different errors or res.text is empty string

In case like this

function index(){
	var things = ['Rock', 'Paper', 'Scissor', 'Apple', 'Appearance', 'Announce'];
	var thing = things[Math.floor(Math.random()*things.length)];
	console.log("original: " + thing)
	translate(thing, { from: 'en', to: 'bg' }).then(res => {
		  console.log("translated: " + res.text)
		}).catch(err => {
		  console.error(err);
	});
	setTimeout(index, 5000);
}

index()

there throws something like:

{ HTTPError
    at translate (C:\Users\User\Desktop\node_test\node_modules\@k3rn31p4nic\google-translate-api\src\index.js:143:8)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  name: 'HTTPError',
  statusCode: 429,
  statusMessage: 'Too Many Requests' }

If text is longer then error is another:

{ HTTPError
    at translate (C:\Users\User\Desktop\node_test\node_modules\@k3rn31p4nic\google-translate-api\src\index.js:143:8)
    at process._tickCallback (internal/process/next_tick.js:68:7) name: 'HTTPError', statusCode: 302, statusMessage: 'Found' }

Do you know how often you can make requests without errors?

from google-translate.

cheesits456 avatar cheesits456 commented on June 23, 2024

Hmm I've been looking into this problem and it seems to be pretty common - from what I've gathered so far, it seems the only way to get around the errors is either to slow down your requests, or use proxies so you don't get ratelimmited by Google

from google-translate.

iamtraction avatar iamtraction commented on June 23, 2024

If text is longer then error is another

How long of a text are you trying to send?

from google-translate.

iamtraction avatar iamtraction commented on June 23, 2024

Closing it as it has become stale. Feel free to reopen if you're still facing the issue and have reproduction steps.

from google-translate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.