Saravananslb / py-googletranslation

pygoogletranslation: Free and Unlimited Google translate API for Python. Translates totally free of charge.
https://saravananslb.github.io/py-googletranslation/
MIT License
156 stars 40 forks source link

How to use the proxy features? #19

Closed jordiyapz closed 3 years ago

jordiyapz commented 3 years ago

Could you provide us some example on using the Translator(proxies=YOUR_PROXY) with actual proxy?

I've tried passing it with string and FreeProxy object from free-proxy module but none worked.

finia2NA commented 3 years ago

The package seems to just pass what was given as the "proxies" argument straight to the requests library:

The documentation of this says that the proxies parameter expects a:

Dictionary mapping protocol to the URL of the proxy.

An example is given here. Seems simple enough :)

Saravananslb commented 3 years ago

Hi Users,

>>> from pygoogletranslation import Translator
>>> proxy = {"http":"http://sampleproxy.com:80"}
>>> translator = Translator(proxies=proxy)

Sorry for the inconvenience caused. please refer doc for further .

Thanks, Saravanan N