Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy Support #64

Closed
cefege opened this issue Jul 4, 2022 · 4 comments
Closed

Proxy Support #64

cefege opened this issue Jul 4, 2022 · 4 comments

Comments

@cefege
Copy link

cefege commented Jul 4, 2022

Please Add proxy support so we can decrease the chance of getting banned when translating from Google for example.

@Animenosekai
Copy link
Owner

We already have proxy support though 🤔

@Animenosekai
Copy link
Owner

Ohhhh I'm sorry I didn't document it, my bad.

To add proxies, you need to pass your own Request instance, with the proxies.

Example

from translatepy.utils.request import Request
from translatepy import Translator

t = Translator(request=Request(proxy_urls=["<your proxy>"]))
t.translate("Hello world", "Japanese")

@cefege
Copy link
Author

cefege commented Jul 8, 2022 via email

@ZhymabekRoman
Copy link
Contributor

Can you please explain what are the differences between GoogleTranslateV1 and GoogleTranslateV2?

Class GoogleTranslateV1 are using Google's new batchexecute (JSONRPC) API that are used in Google Translate web application. Class GoogleTranslateV2 uses official API methods that are used in Google Translate mobile application. In a nutshell, they use different endpoints.

Which one is the recommended method for large scale translation, more stable?

GoogleTranslateV2, as GoogleTranslateV1 does not give an accurate translation, see - #22

For example if GoogleTranslateV1 fails, does it try with GoogleTranslateV2?

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants