(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)
A CLI tool to transfer, sync, and backup playlists on music streaming services

unitunes A command-line interface tool to manage playlists across music streaming services. Introduction unitunes manages playlists across streaming s

Victor Tao 50 Jan 07, 2023
Python library to download market data via Bloomberg, Eikon, Quandl, Yahoo etc.

findatapy findatapy creates an easy to use Python API to download market data from many sources including Quandl, Bloomberg, Yahoo, Google etc. using

Cuemacro 1.3k Jan 04, 2023
A mass creator for Discord's new channel threads.

discord-thread-flooder A mass creator for Discord's new channel threads. (obv created by https://github.com/imvast) Warning: this may lag ur pc if u h

Vast 6 Nov 04, 2022
Discord Mass Report script that uses multiple tokens

Discord-Mass-Report Discord Mass Report script that uses multiple tokens, full credits to https://github.com/hoki0/Discord-mass-report who made it in

cChimney 4 Jun 08, 2022
EthSema - Binary translator for Ethereum 2.0

EthSema is a novel EVM-to-eWASM bytecode translator that can not only ensure the fidelity of translation but also fix commonly-seen vulnerabilities in smart contracts.

weimin 8 Mar 01, 2022
Ivan Telegram Userbot with python

Riviani Ramadhan Ivan-Ubot Pada Dasarnya Ivan-Ubot adalah userbot Telegram modular yang berjalan di Python3 dengan database sqlalchemy. Berbasis Paper

1 Oct 29, 2021
Kang Sticker bot

Kang Sticker Bot A simple Telegram bot which creates sticker packs from other stickers, images, documents and URLs. Based on kangbot Deploy Credits: s

Hafitz Setya 11 Jan 02, 2023
This repository contains code written in the AWS Cloud Development Kit (CDK)

This repository contains code written in the AWS Cloud Development Kit (CDK) which launches infrastructure across two different regions to demonstrate using AWS AppSync in a multi-region setup.

AWS Samples 5 Jun 03, 2022
PyHoroscope - Observational Indian lunisolar calendar, horoscope and matching using the Swiss ephemeris

PyHoroscope Observational Indian lunisolar calendar, horoscope and matching usin

4 Jun 05, 2022
A repo containing toolings and software useful for a DevOps Engineer

DevOps-Tooling A repo containing toolings and software useful for a DevOps Engineer (or if you're setting up your Mac from the beginning) Currently se

Mohamed Abukar 45 Dec 12, 2022
Adds a new git subcommand named "ranch".

Git Ranch This script adds ranch, a new subcommand for git that makes it easier to order 1 Gallon of Kraft Ranch Salad Dressing from Amazon. Installat

Austin T Schaffer 8 Jul 06, 2022
Pure Python 3 MTProto API Telegram client library, for bots too!

Telethon ⭐️ Thanks everyone who has starred the project, it means a lot! Telethon is an asyncio Python 3 MTProto library to interact with Telegram's A

LonamiWebs 7.3k Jan 01, 2023
Zero2 Discord bot is written with Discord.py using Python.

Zero2 Discord bot is written with Discord.py using Python.

Siva Avanish 4 Nov 08, 2021
Projeto sobre BioInformática - MoA (mecanismos de ação)

Projeto: MoA no Paredawn Projeto sobre Bioinformatica - Mecanismos de Ação (MoA) MODELO PREDITIVO PARA PREVER O ATIVAMENTO DO MOA E MODELO PARA PREVER

Junior Torres 36 Feb 15, 2022
Want to play What Would Rather on your Server? Invite the bot now! 😏

What is this Bot? 👀 What You Would Rather? is a Guessing game where you guess one thing. Long Description short Take this example: You typed r!rather

FSP Gang s' YT 3 Oct 18, 2021
A Telegram Bot to display Codeforces Contest Ranklist

CFRankListBot A bot that displays the top ranks for a Codeforces contest. Participants' Details All the details of a participant is in the utils/__ini

Code IIEST 5 Dec 25, 2021
This is Instagram reposter that repost TikTok videos.

from-tiktok-to-instagram-reposter This script reposts videos from Tik Tok to your Instagram account. You must enter the username and password and slee

Mohammed 19 Dec 01, 2022
Powerful Telegram Members Scraping and Adding Toolkit

🔥 Genisys V2.1 Powerful Telegram Members Scraping and Adding Toolkit 🔻 Features 🔺 ADDS IN BULK[by user id, not by username] Scrapes and adds to pub

The Cryptonian 16 Mar 01, 2022
An almost dependency-less, synchronous Discord gateway library meant for my personal use

An almost dependency-less, synchronous Discord gateway library meant for my personal use.

h0nda 4 Feb 05, 2022
A library that allows you to easily mock out tests based on AWS infrastructure.

Moto - Mock AWS Services Install $ pip install moto[ec2,s3,all] In a nutshell Moto is a library that allows your tests to easily mock out AWS Services

Steve Pulec 6.5k Jan 02, 2023