Skip to content Skip to sidebar Skip to footer

Googletrans Throws A ConnectTimeout Error (the Handshake Operation Timed Out)

I am currently working on a translator in Python 3.8.5 but I am not getting an appropriate result. My code thus far is from googletrans import Translator text = '''Vous ĂȘtes fran

Solution 1:

The googletrans API that you are using is the same service as translate.google.com. Unfortunately if you send to much requests using googletrans, your IP will be blocked by google. As this service is not intended to translate a bulk of data. Also in in the documentation of googletrans API it mentioned the following problems.

Note on library usage:

  1. The maximum character limit on a single text is 15k.
  2. Due to limitations of the web version of google translate, this API does not guarantee that the library would work properly at all times. (so please use this library if you don’t care about stability.)
  3. If you want to use a stable API, I highly recommend you to use Google’s official translate API.
  4. If you get HTTP 5xx error or errors like #6, it’s probably because Google has banned your client IP address.

I suggest to use the official Translate API for you to utilize the full potential of the API.


Solution 2:

Just change the name of variable and it works


Post a Comment for "Googletrans Throws A ConnectTimeout Error (the Handshake Operation Timed Out)"