Python 谷歌翻译

Python googletrans

我刚遇到 googletrans python 包。这个包 translates 很好并且似乎使用 google translation API。据我所知,google 翻译 API 不是免费的 googletrans内部 做什么翻译?使用googletrans是否合法

官方文档有这方面的信息:

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.

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. However, this could be blocked at any time.

至于这种做法的合法性,这种东西要看你所在国家的法律了,估计有点off-topic.