(unofficial) Googletrans: Free and Unlimited Google translate API for Python. Translates totally free of charge.

Overview

Googletrans

GitHub license travis status Documentation Status PyPI version Coverage Status Code Climate

Googletrans is a free and unlimited python library that implemented Google Translate API. This uses the Google Translate Ajax API to make calls to such methods as detect and translate.

Compatible with Python 3.6+.

For details refer to the API Documentation.

Features

  • Fast and reliable - it uses the same servers that translate.google.com uses
  • Auto language detection
  • Bulk translations
  • Customizable service URL
  • HTTP/2 support

TODO

more features are coming soon.

  • Proxy support
  • Internal session management (for better bulk translations)

HTTP/2 support

This library uses httpx for HTTP requests so HTTP/2 is supported by default.

You can check if http2 is enabled and working by the ._response.http_version of Translated or Detected object:

>>> translator.translate('테스트')._response.http_version
# 'HTTP/2'

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.


Installation

To install, either use things like pip with the package "googletrans" or download the package and put the "googletrans" directory into your python path.

$ pip install googletrans

Basic Usage

If source language is not given, google translate attempts to detect the source language.

>>> from googletrans import Translator
>>> translator = Translator()
>>> translator.translate('안녕하세요.')
# <Translated src=ko dest=en text=Good evening. pronunciation=Good evening.>
>>> translator.translate('안녕하세요.', dest='ja')
# <Translated src=ko dest=ja text=こんにちは。 pronunciation=Kon'nichiwa.>
>>> translator.translate('veritas lux mea', src='la')
# <Translated src=la dest=en text=The truth is my light pronunciation=The truth is my light>

Customize service URL

You can use another google translate domain for translation. If multiple URLs are provided, it then randomly chooses a domain.

>>> from googletrans import Translator
>>> translator = Translator(service_urls=[
      'translate.google.com',
      'translate.google.co.kr',
    ])

Advanced Usage (Bulk)

Array can be used to translate a batch of strings in a single method call and a single HTTP session. The exact same method shown above works for arrays as well.

>>> translations = translator.translate(['The quick brown fox', 'jumps over', 'the lazy dog'], dest='ko')
>>> for translation in translations:
...    print(translation.origin, ' -> ', translation.text)
# The quick brown fox  ->  빠른 갈색 여우
# jumps over  ->  이상 점프
# the lazy dog  ->  게으른 개

Language detection

The detect method, as its name implies, identifies the language used in a given sentence.

>>> from googletrans import Translator
>>> translator = Translator()
>>> translator.detect('이 문장은 한글로 쓰여졌습니다.')
# <Detected lang=ko confidence=0.27041003>
>>> translator.detect('この文章は日本語で書かれました。')
# <Detected lang=ja confidence=0.64889508>
>>> translator.detect('This sentence is written in English.')
# <Detected lang=en confidence=0.22348526>
>>> translator.detect('Tiu frazo estas skribita en Esperanto.')
# <Detected lang=eo confidence=0.10538048>

GoogleTrans as a command line application

$ translate -h
usage: translate [-h] [-d DEST] [-s SRC] [-c] text

Python Google Translator as a command-line tool

positional arguments:
  text                  The text you want to translate.

optional arguments:
  -h, --help            show this help message and exit
  -d DEST, --dest DEST  The destination language you want to translate.
                        (Default: en)
  -s SRC, --src SRC     The source language you want to translate. (Default:
                        auto)
  -c, --detect

$ translate "veritas lux mea" -s la -d en
[veritas] veritas lux mea
    ->
[en] The truth is my light
[pron.] The truth is my light

$ translate -c "안녕하세요."
[ko, 1] 안녕하세요.

Note on library usage

DISCLAIMER: this is an unofficial library using the web API of translate.google.com and also is not associated with Google.

  • The maximum character limit on a single text is 15k.
  • 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).
  • Important: If you want to use a stable API, I highly recommend you to use Google's official translate API.
  • If you get HTTP 5xx error or errors like #6, it's probably because Google has banned your client IP address.

Versioning

This library follows Semantic Versioning from v2.0.0. Any release versioned 0.x.y is subject to backwards incompatible changes at any time.

Contributing

Contributions are more than welcomed. See CONTRIBUTING.md


License

Googletrans is licensed under the MIT License. The terms are as follows:

The MIT License (MIT)

Copyright (c) 2015 SuHun Han

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Comments
  • Found a Google Translate endpoint that doesn't require an API key.

    Found a Google Translate endpoint that doesn't require an API key.

    This isn't a bug report, just a sharing of some findings while looking through minified source code.

    While digging through the source code of Google's Google Dictionary Chrome extension, which has support for translating via Google Translate, I found the endpoint they use in order to do just that. Since googletrans frequently runs into 5xx errors, it might be useful to switch off to another endpoint, although this one is also annoyingly touchy with 403s.

    Breakdown

    Endpoint: https://clients5.google.com/translate_a/t

    Query Parameters

    | Query Parameter | Default | Notes | |-----------------|------------------|---------------------------------------------------------------| | client | dict-chrome-ex | Needs to be dict-chrome-ex or else you'll get a 403 error. | | sl | auto | Designates the source language of the text to translate. | | tl | (none) | Designates the destination language of the text to translate. | | q | (none) | Text to translate |

    Example Response

    URL: https://clients5.google.com/translate_a/t?client=dict-chrome-ex&sl=auto&tl=en&q=bonjour

    {
      "sentences": [
        {
          "trans": "Hello",
          "orig": "bonjour",
          "backend": 1
        }
      ],
      "dict": [
        {
          "pos": "interjection",
          "terms": [
            "Hello!",
            "Hi!",
            "Good morning!",
            "Good afternoon!",
            "How do you do?",
            "Hallo!",
            "Hullo!",
            "Welcome!"
          ],
          "entry": [
            {
              "word": "Hello!",
              "reverse_translation": [
                "Bonjour!",
                "Salut!",
                "Tiens!",
                "Allô!"
              ],
              "score": 0.7316156
            },
            {
              "word": "Hi!",
              "reverse_translation": [
                "Salut!",
                "Bonjour!",
                "Hé!"
              ],
              "score": 0.084690653
            },
            {
              "word": "Good morning!",
              "reverse_translation": [
                "Bonjour!"
              ],
              "score": 0.065957151
            },
            {
              "word": "Good afternoon!",
              "reverse_translation": [
                "Bonjour!"
              ],
              "score": 0.02749503
            },
            {
              "word": "How do you do?",
              "reverse_translation": [
                "Bonjour!",
                "Salut!",
                "Ça marche?"
              ]
            },
            {
              "word": "Hallo!",
              "reverse_translation": [
                "Bonjour!",
                "Tiens!",
                "Salut!",
                "Allô!"
              ]
            },
            {
              "word": "Hullo!",
              "reverse_translation": [
                "Tiens!",
                "Allô!",
                "Salut!",
                "Bonjour!"
              ]
            },
            {
              "word": "Welcome!",
              "reverse_translation": [
                "Salut!",
                "Bonjour!",
                "Soyez le bienvenu!"
              ]
            }
          ],
          "base_form": "Bonjour!",
          "pos_enum": 9
        }
      ],
      "src": "fr",
      "alternative_translations": [
        {
          "src_phrase": "bonjour",
          "alternative": [
            {
              "word_postproc": "Hello",
              "score": 1000,
              "has_preceding_space": true,
              "attach_to_next_token": false
            }
          ],
          "srcunicodeoffsets": [
            {
              "begin": 0,
              "end": 7
            }
          ],
          "raw_src_segment": "bonjour",
          "start_pos": 0,
          "end_pos": 0
        }
      ],
      "confidence": 0.96875,
      "ld_result": {
        "srclangs": [
          "fr"
        ],
        "srclangs_confidences": [
          0.96875
        ],
        "extended_srclangs": [
          "fr"
        ]
      },
      "query_inflections": [
        {
          "written_form": "bonjour",
          "features": {
            "gender": 1,
            "number": 2
          }
        },
        {
          "written_form": "bonjours",
          "features": {
            "gender": 1,
            "number": 1
          }
        },
        {
          "written_form": "bonjour",
          "features": {
            "number": 2
          }
        },
        {
          "written_form": "bonjours",
          "features": {
            "number": 1
          }
        }
      ]
    }
    
    pinned 
    opened by SuperSonicHub1 60
  • AttributeError: 'NoneType' object has no attribute 'group'

    AttributeError: 'NoneType' object has no attribute 'group'

    My script like this: #-- coding:utf-8 -- from googletrans import Translator import sys import io

    translator = Translator() tanstext = u'我们' tran_ch = translator.translate(tanstext ).text print tran_ch ############### yesterday this is ok and no problem,but today I run my script without internet, show some problem.And I run the script in the internet environment, but it's show same problem,can't run. The cmd show the Traceback like this: Traceback (most recent call last): File "D:\JDstory\workstory\translation-project\filetocut\trans-test.py", line 10, in tran_ch = translator.translate(tanstext).text File "D:\software\Python27\lib\site-packages\googletrans\client.py", line 132, in translate data = self._translate(text, dest, src) File "D:\software\Python27\lib\site-packages\googletrans\client.py", line 57, in _translate token = self.token_acquirer.do(text) File "D:\software\Python27\lib\site-packages\googletrans\gtoken.py", line 180, in do self._update() File "D:\software\Python27\lib\site-packages\googletrans\gtoken.py", line 59, in _update code = unicode(self.RE_TKK.search(r.text).group(1)).replace('var ', '') AttributeError: 'NoneType' object has no attribute 'group' ######################### That's why? Thank you so much!

    opened by halleyshx 40
  • Feature/enhance use of direct api

    Feature/enhance use of direct api

    In a perspective to help solving issue #234 I propose a solution that implements a proper way to use translate.googleapis.com as url service. This url service has following characteristics:

    • no need for a token
    • uses client gtx instead of webapp I made a few modifications to mainly deal with these characteristics, preserving the possibility to use standard webapp calls. The client should use 'translate.googleapis.com' as service url when instanciating Translator() object, adapted code will manage the valuation of client gtx in utils params. Looking forward to reading your remarks for improvement is needed before final merge.
    opened by alainrouillon 38
  • json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

    json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

    I am trying to translate a list of tokens from chinese to english. I get the following error after a few attempts of translation. Is this because of rate limits?

    File "/home/sharath/.local/lib/python3.5/site-packages/googletrans/client.py", line 127, in translate
       translated = self.translate(item, dest=dest, src=src)
     File "/home/sharath/.local/lib/python3.5/site-packages/googletrans/client.py", line 132, in translate
       data = self._translate(text, dest, src)
     File "/home/sharath/.local/lib/python3.5/site-packages/googletrans/client.py", line 63, in _translate
       data = utils.format_json(r.text)
     File "/home/sharath/.local/lib/python3.5/site-packages/googletrans/utils.py", line 62, in format_json
       converted = legacy_format_json(original)
     File "/home/sharath/.local/lib/python3.5/site-packages/googletrans/utils.py", line 54, in legacy_format_json
       converted = json.loads(text)
     File "/data/anaconda2/envs/dlatk/lib/python3.5/json/__init__.py", line 319, in loads
       return _default_decoder.decode(s)
     File "/data/anaconda2/envs/dlatk/lib/python3.5/json/decoder.py", line 339, in decode
       obj, end = self.raw_decode(s, idx=_w(s, 0).end())
     File "/data/anaconda2/envs/dlatk/lib/python3.5/json/decoder.py", line 357, in raw_decode
       raise JSONDecodeError("Expecting value", s, err.value) from None
    json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
    
    opened by chandrasg 33
  • googletrans 4.0.0-rc1 fails with TypeError: 'NoneType' object is not iterable on client.py:222

    googletrans 4.0.0-rc1 fails with TypeError: 'NoneType' object is not iterable on client.py:222

    Googletrans version:

    • 4.0.0rc1

    I'm submitting a ...

    • [x] bug report
    • [ ] feature request

    Current behavior:

    python3
    Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from googletrans import Translator
    >>> translator = Translator()
    >>> print(translator.translate("Author", src="en", dest="de").text)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "c:\Users\Max\AppData\Local\Programs\Python\Python37-32\lib\site-packages\googletrans\client.py", line 222, in translate
        translated_parts = list(map(lambda part: TranslatedPart(part[0], part[1] if len(part) >= 2 else []), parsed[1][0][0][5]))
    TypeError: 'NoneType' object is not iterable
    

    Expected behavior:

    I expect the "Author" word in deuch

    Steps to reproduce:

    • Install googletrans 4.0.0-rc1
    • Call python and make steps from "Current behavior"
    bug wontfix 
    opened by MaxBrain 28
  • AttributeError: 'NoneType' object has no attribute 'group'

    AttributeError: 'NoneType' object has no attribute 'group'

    I'm using one of the basic code:

    from googletrans import Translator
    
    translator = Translator()
    
    translation=translator.translate('안녕하세요.', dest='ja')
    
    print(translation)
    

    And I'm getting an attribute error : AttributeError: 'NoneType' object has no attribute 'group'

    Please let me know if the module is still working properly.

    wontfix 
    opened by Itz-MrJ 23
  • Google Trans - Giving me same Input as Output

    Google Trans - Giving me same Input as Output

    Googletrans version:

    • 3.x

    I'm submitting a ...

    • bug report

    Current behavior: I am trying to translate from AWS EC2 Instance with googletrans python library using below snippet:

    translator = Translator(service_urls=['translate.google.com', 'translate.google.co.kr'])
    translated_text = str(translator.translate("你好!", dest="en").text)
    
    print(translated_text) # <------- outputs to 你好! but it should be ideally Hello there
    

    Even I tried with proxy like below where I read proxy from file and use it at translator() method, but no luck:

    translator = Translator(service_urls=['translate.google.com', 'translate.google.co.kr'],proxies=proxy)
    translated_text = str(translator.translate("你好!", dest="en").text)
    print(translated_text)
    

    The same code was working for 6+ months at same instance, but from last 2-3 days , I am getting output same as input. I checked it translate.google.com , it was working fine, so thought it would be a bug with googletrans

    Current Behaviour:

    Suppose if I want to translate 你好! to English , At Output , I am getting same value "你好!" - before that it converts to "Hello there".

    Environment:

    1. Ubuntu 16.04.6 LTS
    2. Python 3.7.3
    3. GoogleTrans - 3.0.0, httpcore - 0.9.1 , httpx - 0.13.3
    4. AWS Region : US_EAST

    Please help me to figure out root-cause of this error. The same code works on different machine - is there any limitation on IP?

    Even for Single text, this is happening. Any help appreciated, Thanks!

    opened by mohamedniyaz1996 23
  • [Error] Google changed their API... again

    [Error] Google changed their API... again

    Google has changed their API yet again. Using this tool and the fix in #78 no longer works as it now gives this error:

    \googletrans\gtoken.py", line 66, in _update code = unicode(self.RE_TKK.search(r.text).group(1)).replace('var ', '') AttributeError: 'NoneType' object has no attribute 'group'

    Does anybody have an idea how to fix this?

    opened by Darkblader24 22
  • NoneType return on Advanced Bulk version 4.0.0-rc1

    NoneType return on Advanced Bulk version 4.0.0-rc1

    Googletrans version:

    • [x] 4.0.0-rc1
    • [ ] 3.x
    • [ ] 2.x

    I'm submitting a ...

    • [x] bug report
    • [ ] feature request

    Current behavior:

    I tried to use the bulk translate from sample code on documentation page. The translate method return error TypeError: the JSON object must be str, bytes or bytearray, not 'NoneType'

    Expected behavior:

    Should be same as written in documentation page. Bulk translate must return collection of translated object

    Steps to reproduce:

    Use list of string as an input parameter translate method

    Related code:

    translator = Translator(service_urls=[
          'translate.google.com',
          'translate.google.co.kr',
        ])
    
    translations = translator.translate(['The quick brown fox', 'jumps over', 'the lazy dog'], dest='ko')
    for translation in translations:
        print(translation.origin, ' -> ', translation.text)
    
    TypeError                                 Traceback (most recent call last)
    <ipython-input-21-14c1e5590012> in <module>()
          4     ])
          5 
    ----> 6 translations = translator.translate(['The quick brown fox', 'jumps over', 'the lazy dog'], dest='ko')
          7 for translation in translations:
          8     print(translation.origin, ' -> ', translation.text)
    
    1 frames
    /usr/lib/python3.6/json/__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
        346         if not isinstance(s, (bytes, bytearray)):
        347             raise TypeError('the JSON object must be str, bytes or bytearray, '
    --> 348                             'not {!r}'.format(s.__class__.__name__))
        349         s = s.decode(detect_encoding(s), 'surrogatepass')
        350 
    
    TypeError: the JSON object must be str, bytes or bytearray, not 'NoneType'
    

    Other information:

    bug wontfix 
    opened by AkmalPratama 19
  • error in googletrans 4.0.0rc1 translator

    error in googletrans 4.0.0rc1 translator

    I tried the new version of googletrans 4.0.0rc1.

    translator = Translator(service_urls=['translate.google.com'])
    res = translator.translate(text)
    

    After some time an exception occurs: AttributeError: 'Translator' object has no attribute 'raise_Exception'

    To fix this I need to execute this line:

    translator.raise_Exception = True

    And then the exception writes: Exception: Unexpected status code "429" from ['translate.google.com']

    bug wontfix 
    opened by DanilKonon 17
  • raise JSONDecodeError

    raise JSONDecodeError

    Hi, my code is just simply as follows:

    import googletrans from googletrans import Translator translator = Translator() translator.translate('bonjour')

    I would like to test the package and the text is so short within the limit. But it raise error: raise JSONDecodeError("Expecting value", s, err.value) from None

    and the error message is JSONDecodeError: Expecting value

    Can anybody help me? It is really urgent and I don't know how to deal with it since the text is so short. Thanks a lot!

    opened by VionaWang 14
  • Ignore hashtags option or Ignore place

    Ignore hashtags option or Ignore place

    please append Ignore hashtags translation or an option to set ignored places for example I dont want to translate word jeff in my text: I see jeff at home.

    And it will ignore jeff in translation. with this call : translate('I see jeff at #home.',ignore_char='_', ignore_hashtags=True) also home will not translate cuz of ignore_hashtags variable

    opened by mablue 0
  • Does googletrans has cost?

    Does googletrans has cost?

    Hello,

    I have a question. I am using googletrans for translating several languages to English. But I as thinking If there is cost using this package since I have many labels which need to be translated daily.

    It will be great If you inform me about that.

    Best regards, Narges

    opened by Jami1141 0
  • TypeError: 'NoneType' object is not iterable; when translate words disappointed and delicious from english to italian

    TypeError: 'NoneType' object is not iterable; when translate words disappointed and delicious from english to italian

    Googletrans version:

    • [X] 4.0.0rc1
    • [ ] 3.1.0a0
    • [ ] 3.0.0
    • [ ] 2.x

    I'm submitting a ...

    • [X] bug report
    • [ ] feature request

    Current behavior:

    When try to translate a phrase like "Disappointed!" and "Delicious", in any form like "disappointed" or "disappointed!." or "DELICIOUS!" and so on, the library returns the TypeError described in the title.

    Expected behavior:

    Translate the word "Disappointed" to "Deluso". Translate the word "Delicious" to "Delizioso".

    Steps to reproduce:

    Run one of the codes in Related code.

    Related code:

    Example 1
    import googletrans
    translator = googletrans.Translator()
    result=translator.translate('Disappinted!', src='en', dest='it')
    print(result.text)
    
    Example 2
    import googletrans
    translator = googletrans.Translator()
    result=translator.translate('DELICIOUS!!', src='en', dest='it')
    print(result.text)
    

    Other information:

    I think the error is caused by the fact that in Italian Disappointed and Delicious, if there isn't a specific subject that indicates if translate them in male or female form, are translatable in "Deluso" or "Delusa" (for disappointed) and "Delizioso" or "Deliziosa" (for delicious) .

    opened by Franz95 3
  • AttributeError: 'NoneType' object has no attribute 'group'

    AttributeError: 'NoneType' object has no attribute 'group'

    • [X] bug report
    • [ ] feature request

    When I try to follow the guide given in the documentation I get an error.

    from googletrans import Translator
    translator = Translator()
    
    translator.translate('Mitä sinä teet')
    
    
    >>>AttributeError: 'NoneType' object has no attribute 'group'
    
    opened by MGriot 10
  • AttributeError: 'NoneType' object has no attribute 'group'

    AttributeError: 'NoneType' object has no attribute 'group'

    Googletrans version:

    • [ ] 4.0.0rc1
    • [ ] 3.1.0a0
    • [x] 3.0.0
    • [ ] 2.x

    I'm submitting a...

    • [x] bug report
    • [ ] feature request

    Current behavior:

    It throws AttributeError: 'NoneType' object has no attribute 'group' error.

    Expected behavior:

    Print the translated text of "我覺得今天天氣不好" Related code:

    There is the full error

    Traceback (most recent call last):
      File "C:\Users\hong\Desktop\VS_codes\line_bot\venv\lib\site-packages\flask\app.py", line 2070, in wsgi_app
        response = self.full_dispatch_request()
      File "C:\Users\hong\Desktop\VS_codes\line_bot\venv\lib\site-packages\flask\app.py", line 1515, in full_dispatch_request
        rv = self.handle_user_exception(e)
      File "C:\Users\hong\Desktop\VS_codes\line_bot\venv\lib\site-packages\flask\app.py", line 1513, in full_dispatch_request
        rv = self.dispatch_request()
      File "C:\Users\hong\Desktop\VS_codes\line_bot\venv\lib\site-packages\flask\app.py", line 1499, in dispatch_request
        return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
      File "C:/Users/hong/Desktop/VS_codes/line_bot/app.py", line 126, in callback
        handler.handle(body, signature)
      File "C:\Users\hong\Desktop\VS_codes\line_bot\venv\lib\site-packages\linebot\webhook.py", line 260, in handle
        self.__invoke_func(func, event, payload)
      File "C:\Users\hong\Desktop\VS_codes\line_bot\venv\lib\site-packages\linebot\webhook.py", line 272, in __invoke_func
        func(event)
      File "C:/Users/hong/Desktop/VS_codes/line_bot/app.py", line 198, in handle_message
        print('English:', translator.translate('我覺得今天天氣不好', dest='en').text)
      File "C:\Users\hong\Desktop\VS_codes\line_bot\venv\lib\site-packages\googletrans\client.py", line 182, in translate
        data = self._translate(text, dest, src, kwargs)
      File "C:\Users\hong\Desktop\VS_codes\line_bot\venv\lib\site-packages\googletrans\client.py", line 78, in _translate
        token = self.token_acquirer.do(text)
      File "C:\Users\hong\Desktop\VS_codes\line_bot\venv\lib\site-packages\googletrans\gtoken.py", line 194, in do
        self._update()
      File "C:\Users\hong\Desktop\VS_codes\line_bot\venv\lib\site-packages\googletrans\gtoken.py", line 62, in _update
        code = self.RE_TKK.search(r.text).group(1).replace('var ', '')
    AttributeError: 'NoneType' object has no attribute 'group'
    

    And my code

    translator = googletrans.Translator()
    print(translator.translate('我覺得今天天氣不好', dest='en').text)
    
    opened by Nat1anWasTaken 31
Releases(1.2)
  • 1.2(Jul 17, 2015)

    This release of py-googletrans includes following updates:

    • 29819f7: Add languages, and print exception with details
    • #1: FIx unicode error in the CLI result
    • #2: Prevent invalid language codes being passed to the translate function, and add a converter that substitutes for special cases
    Source code(tar.gz)
    Source code(zip)
Owner
Suhun Han
Node and Go enthusiast. [email protected]
Suhun Han
streamlit translator is used to detect and translate between languages created using gTTS, googletrans, pillow and streamlit python packages

Streamlit Translator Streamlit Translator is a simple translator app to detect and translate between languages. Streamlit Translator gets text and lan

Siva Prakash 5 Apr 5, 2022
💻 Discord-Auto-Translate-Bot - If you type in the chat room, it automatically translates.

?? Discord-Auto-Translate-Bot - If you type in the chat room, it automatically translates.

LeeSooHyung 2 Jan 20, 2022
Translates English into Mandalorian (Mando'a) utilizing a "funtranslations" free API

Mandalorian Translator Translates English into Mandalorian (Mando'a) utilizing a "funtranslations" free API About I created this app to experiment wit

Hayden Covington 1 Dec 4, 2021
This is a translator that i made by myself in python with the 'googletrans' library

Translator-Python This is a translator that i made by myself in python with the 'googletrans' library This application completely made in python allow

Thadeuks 2 Jun 17, 2022
A hilarious program that translates text to Google's

Bork, bork, bork! A hilarious program that translates text in a file to Google's "bork bork bork' language. How to use Download the main.py file. Chan

The Algorithmic 1 Dec 17, 2021
AirDrive lets you store unlimited files to cloud for free. Upload & download files from your personal drive at any time using its super-fast API.

AirDrive lets you store unlimited files to cloud for free. Upload & download files from your personal drive at any time using its super-fast API.

Sougata 4 Jul 12, 2022
A simple language translator with python and google translate api

Language translator with python A simple language translator with python and google translate api Install pip and python 3.9. All the required depende

null 0 Nov 11, 2021
🚧 finCLI's own News API. No more limited API calls. Unlimited credible and latest information on BTC, Ethereum, Indian and Global Finance.

?? finCLI's own News API. No more limited API calls. Unlimited credible and latest information on BTC, Ethereum, Indian and Global Finance.

finCLI 5 Jun 16, 2022
Free and Open Source Machine Translation API. 100% self-hosted, no limits, no ties to proprietary services. Built on top of Argos Translate.

LibreTranslate Try it online! | API Docs Free and Open Source Machine Translation API, entirely self-hosted. Unlike other APIs, it doesn't rely on pro

UAV4GEO 3.5k Jan 3, 2023
A Simple Google Translate Bot By VndGroup ❤️ Made With Python

VndGroup Google Translator Heroku Deploy ❤️ Functions This Bot Can Translate 95 Languages We Can Set Custom Language Group Support Mandatory Vars [+]

Venuja Sadew 1 Oct 9, 2022
Telegram Google Translater Bot Can Translate Any Language To Your Selected Language

?? TELEGRAM GOOGLE TRANSLATER ?? • ⚡ INSTALLING ⚡ • • ✅ OFFICIAL SUPPORTS ✅ •

⚝ANKIT KUMAR⚝ 2 Jan 16, 2022
First Party data integration solution built for marketing teams to enable audience and conversion onboarding into Google Marketing products (Google Ads, Campaign Manager, Google Analytics).

Megalista Sample integration code for onboarding offline/CRM data from BigQuery as custom audiences or offline conversions in Google Ads, Google Analy

Google 76 Dec 29, 2022
🔍 Google Search unofficial API for Python with no external dependencies

Python Google Search API Unofficial Google Search API for Python. It uses web scraping in the background and is compatible with both Python 2 and 3. W

Avi Aryan 204 Dec 28, 2022
UNLIMITED CALL AND SMS BOMBING PYTHON SCRIPT

cc_sim_crack v.1 An open-source SMS/call bomber for Linux And Termux. Note: Due misusing of cc_sim_crack, several API's died. Don't be afraid if you d

CYBER CRACKER OFFICIAL 3 Jul 5, 2021
Braje: a python based credit hacker tool. Hack unlimited RAJE LIKER app Credit

#ReCoded Evan Al Mahmud Irfan ✨ ථ BRAJE 1.0 AUTO LIKER, AUTO COMMENT AND AUTO FOLLOWER APP CREDIT HACKER TOOL About Braje: Braje is a python based cre

Evan Al Mahmud Irfan ථ 2 Dec 23, 2021
Robot to convert files to direct links, hosting files on Telegram servers, unlimited and without restrictions

stream-cloud demo : downloader_star_bot Run : Docker : install docker , docker-compose set Environment or edit Config/init.py docker-compose up Heroku

null 53 Dec 21, 2022
Add members to unlimited telegram channels and groups

Program Features ?? Coded with Python version 10. ?? without the need for a proxy. ?? without the need for a Telegram ID. ?? Ability to add infinite p

hack4lx 10 Nov 25, 2022
Unlimited Filter Telegram Bot 2

Mother NAther Bot Features Auto Filter Manuel Filter IMDB Admin Commands Broadcast Index IMDB search Inline Search Random pics ids and User info Stats

LɪᴏɴKᴇᴛᴛʏUᴅ 1 Oct 30, 2021
A Telegram Filter Bot, Support Unlimited Filter. Also, The Bot can auto-filter telegram File | video

A Telegram Filter Bot, Support Unlimited Filter. Also, The Bot can auto-filter telegram File | video

Hash Minner 3 Nov 27, 2021