php-google-translate-free icon indicating copy to clipboard operation
php-google-translate-free copied to clipboard

Using Proxy

Open Blair2004 opened this issue 3 years ago • 17 comments

Hi, Thank you for your work. I have a question, is there a way to make the library works (makes requests) via a proxy. Because if we do a lot of translation request to Google, somehow the IP gets banned. So, using a proxy might prevent this.

Thanks.

Blair2004 avatar Apr 12 '21 20:04 Blair2004

error: "Google detected unusual traffic from your computer network, try again later (2 - 48 hours)"

mega94 avatar Apr 13 '21 10:04 mega94

How to use proxy? Will you please let us know?

ermeh avatar Apr 18 '21 13:04 ermeh

I thought I have explained already... This consist of using a collection of random IP that can be used to prevent bans from too many request error.

Blair2004 avatar Apr 18 '21 14:04 Blair2004

I know that :) Just asking how we can integrate proxies to this script.

ermeh avatar Apr 18 '21 14:04 ermeh

If the script is proceeding request to a remote service I guess the HTTP client should offer such option. I don't know if the scripts use Guzzle, but with that, you can define a proxy client.

https://docs.guzzlephp.org/en/stable/request-options.html#proxy

Blair2004 avatar Apr 18 '21 18:04 Blair2004

I think this question must be replied by the script developer.

ermeh avatar Apr 18 '21 20:04 ermeh

When you asked your question, I'm sorry if I believed you were talking to me. I also didn't notice you're highjacking the thread. 😅😅😅

Blair2004 avatar Apr 19 '21 00:04 Blair2004

I'm having the same problem, did you solve it?

carlosvaldesweb avatar May 04 '21 23:05 carlosvaldesweb

I've got the same issue, did anybody solve it?

aydinrzyv avatar May 05 '21 00:05 aydinrzyv

I have a question, can I find out why you want to use a proxy? In case of connecting it and making many requests, Google will ban the proxy's IP, therefore, will it also stop working, or do I forget something?

mcolominas avatar Nov 25 '21 20:11 mcolominas

Me, I fixed this issue a while ago. I'm using a home made script (adonisjs) that is based on the Chrome Extension of Google Translate. That script work far beyond my expectations as it can safely translate an HTML page with tags.

I'm using many different premium proxies to make sure, whatever translation I have to do during a day, I won't get banned. I thinking releasing it as a package for Laravel, I'm just meanwhile very busy.

Blair2004 avatar Nov 26 '21 00:11 Blair2004

Hello @Blair2004 , by premium proxies you mean paid proxies?

mcolominas avatar Nov 26 '21 10:11 mcolominas

Hello @Blair2004 , by premium proxies you mean paid proxies?

Yes.

Blair2004 avatar Nov 26 '21 10:11 Blair2004

@Blair2004 I don't know how much money you will be paying to use the proxies, but since you pay, wouldn't it be better for you to use this https://github.com/statickidz/php-google-translate-free/issues/38#issuecomment-979448295? it also has a function to translate html

mcolominas avatar Nov 26 '21 11:11 mcolominas

Hi, I'm paying around $4 monthly, I have created a multilingual (16 languages) blog and so far the tool I created translate very well. Most translation packages :

  • doesn't translate well (accuracy)
  • doesn't support HTML

That's the reason why I stopped using those.

Blair2004 avatar Nov 26 '21 11:11 Blair2004

So I do not understand it, what I have put in that comment is the translation paid google service, so it would have to be better than the free one and also, if it supports html https://cloud.google.com/translate/docs/reference/rest/v2/translate

If you say that you are already happy with what you use, use that, I'll be waiting for you to take out the package (if you take it out) to see how you have done it.

mcolominas avatar Nov 26 '21 11:11 mcolominas

Is there anyone who adds proxies to this script and is happy with the way it works?

ermeh avatar Jan 26 '23 16:01 ermeh