iamtraction / google-translate

🈯 A Node.JS library to consume Google Translate API for free.
https://npmjs.com/@iamtraction/google-translate
MIT License
540 stars 73 forks source link

Proxy support #8

Closed Adizbek closed 5 years ago

Adizbek commented 5 years ago

Usage


const t = require('@k3rn31p4nic/google-translate-api');

const resp = t('Hello', {
  from: 'en',
  to: 'ru',

  proxies: [
    { host: '134.209.1.204', port: 8080 }
  ]
});

resp.then(x => {
  console.log(x);
}).catch(x => {
  console.log(x);
});

I didn't check proxy above

Should fix #5

Adizbek commented 5 years ago

I thought, picking random proxy is better because it will decrease chance getting blocked.

iamtraction commented 5 years ago

Nevermind, I just saw your PR comment and didn't notice that you were already exposing the proxies option to the user. I thought you hardcoded that IP. My bad.

ZuBB commented 5 years ago

I have tried to test this code for my case with help of https://github.com/chill117/proxy-lists and https://github.com/chill117/proxy-verifier but failed to succeed. My guess is that I did not pick right proxy

I didn't check proxy above

Hope you had a successful run of this PR

Adizbek commented 5 years ago

@ZuBB I think found another solution. Proxy didn't give any benefit, so I removed it. #10 just look at this PR, I am using this on my server for now, works great.

Try

npm install github:Adizbek/google-translate-api#32cb90c49792c3a65c6893e2c3487b1a3a01c1e0 --save
MaxySpark commented 4 years ago

@Adizbek so, Is there any way to use proxy now

Adizbek commented 4 years ago

No, as I am not facing this problem anymore, I gave up working on it.