(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)
PackMyPayload - Emerging Threat of Containerized Malware

This tool takes a file or directory on input and embeds them into an output file acting as an archive/container.

Mariusz Banach 594 Dec 29, 2022
Discord group chat spammer concept.

GC Spammer [Concept] GC-Spammer for https://discord.com/ Warning: This is purely a concept. In the past the script worked, however, Discord ratelimite

Roover 3 Feb 28, 2022
Script for downloading Coursera.org videos and naming them.

Coursera Downloader Coursera Downloader Introduction Features Disclaimer Installation instructions Recommended installation method for all Operating S

Coursera Downloader 9k Jan 02, 2023
Yes, it's true :purple_heart: This repository has 353 stars.

Yes, it's true! Inspired by a similar repository from @RealPeha, but implemented using a webhook on AWS Lambda and API Gateway, so it's serverless! If

510 Dec 28, 2022
Discord spam bots with multiple account support and more

Discord spam bots with multiple account support and more. PLEASE READ EVERYTHING BEFORE WRITING AN ISSUE!! Server Messages Text Image Dm Messages Text

Mr. Nobody 6 Sep 14, 2022
Compulsory join Telegram Bot

mussjoin About Compulsory join Telegram Bot this Telegram Bot Application can be added users to Telegram Channel or Group compulsorily. in addition wh

Hamed Mohammadvand 4 Dec 03, 2021
Ever wanted a dashboard for making your antispam? This is it.

Ever wanted a dashboard for making your antispam? This is it.

Skelmis 1 Oct 27, 2021
Elkeid HUB - A rule/event processing engine maintained by the Elkeid Team that supports streaming/offline data processing

Elkeid HUB - A rule/event processing engine maintained by the Elkeid Team that supports streaming/offline data processing

Bytedance Inc. 61 Dec 29, 2022
Deepl - DeepL Free API For Python

DeepL DeepL Free API Notice Since I don't want to make my AuthKey public, if you

Vincent Young 4 Apr 11, 2022
Hydro Quebec API wrapper.

HydroQC Hydro Quebec API wrapper. This is a package to access some functionalities of Hydro Quebec API that are not documented. Documentation https://

Olivier BEAU 9 Dec 02, 2022
Repositório para a Live Coding do dia 22/12/2021 sobre AWS Step Functions

DIO Live Step Functions - 22/12/2021 Serviços AWS utilizados AWS Step Functions AWS Lambda Amazon S3 Amazon Rekognition Amazon DynamoDB Amazon Cloudwa

Cassiano Ricardo de Oliveira Peres 5 Mar 01, 2022
A Really Simple and Advanced Google Colab NoteBook to Setup and start using Rclone on Google Colab easily.

Rclone on Google Colab (Advanced!) 🔥 1.Setup and Start using Rclone on Google Colab and Create/Edit/View and delete your Rclone config file and keep

Dr.Caduceus 14 May 24, 2022
A modular telegram Python bot running on python3 with an sqlalchemy database.

TG_Bot A modular telegram Python bot running on python3 with an sqlalchemy database. Originally a simple group management bot with multiple admin feat

Movindu Bandara 1 Nov 02, 2021
MVP monorepo to rapidly develop scalable, reliable, high-quality components for Amazon Linux instance configuration management

Ansible Amazon Base Repository Ansible Amazon Base Repository About Setting Up Ansible Environment Configuring Python VENV and Ansible Editor Configur

Artem Veremey 1 Aug 06, 2022
this is a telegram bot repository, that can stream video on telegram group video chat.

VIDEO STREAM BOT telegram bot project for streaming video on telegram video chat, powered by tgcalls and pyrogram 🛠 Commands: /vstream (reply to vide

levina 319 Aug 15, 2022
AnyAPI is a library that helps you to write any API wrapper with ease and in pythonic way.

AnyAPI AnyAPI is a library that helps you to write any API wrappers with ease and in pythonic way. Features Have better looking code using dynamic met

Fatih Kilic 129 Sep 20, 2022
Jira-cache - Jira cache with python

Direct queries to Jira have two issues: they are sloooooow many queries are impo

John Scott 6 Oct 08, 2022
Bot for Telegram data Analysis

Bot Scraper for telegram This bot use an AI to Work powered by BOG Team you must do the following steps to make the bot functional: Install the requir

8 Nov 28, 2022
Scrape Twitter for Tweets

Backers Thank you to all our backers! 🙏 [Become a backer] Sponsors Support this project by becoming a sponsor. Your logo will show up here with a lin

Ahmet Taspinar 2.2k Jan 02, 2023
StringSessionGenerator - A Telegram bot to generate pyrogram and telethon string session

⭐️ String Session Generator ⭐️ Genrate String Session Using this bot. Made by TeamUltronX 🔥 String Session Demo Bot: Environment Variables Mandatory

TheUltronX 1 Dec 31, 2021