简体   繁体   English

Python googletrans

[英]Python googletrans

I just came across googletrans python package. 我刚刚遇到了googletrans python包。 This package translates quite well and seems to use google translation API . 这个包翻译得很好,似乎使用谷歌 翻译 API To my knowledge, google translation API is not free . 据我所知,谷歌翻译API 不是免费的 What googletrans doing internally for the translations? googletrans内部为翻译做些什么? Is it legal to use googletrans ? 使用googletrans是否合法

The official documentation has information on this: 官方文档有关于此的信息:

https://pypi.python.org/pypi/googletrans#how-does-this-library-work https://pypi.python.org/pypi/googletrans#how-does-this-library-work

You may wonder why this library works properly, whereas other approaches such like goslate won't work since Google has updated its translation service recently with a ticket mechanism to prevent a lot of crawler programs. 您可能想知道为什么这个库正常工作,而像goslate这样的其他方法将无法工作,因为Google最近使用票证机制更新了其翻译服务,以防止大量的爬虫程序。

I eventually figure out a way to generate a ticket by reverse engineering on the obfuscated and minified code used by Google to generate such token, and implemented on the top of Python. 我最终找到了一种方法,通过逆向工程生成一张票据,用于生成这种令牌的混淆和缩小的代码,并在Python的顶部实现。 However, this could be blocked at any time . 但是,这可能随时被阻止

As for the legality of this approach, this kind of stuff depends on the laws of the countries you live in, and is probably slightly off-topic. 至于这种方法的合法性,这种东西取决于你所居住的国家的法律,并且可能略微偏离主题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM