(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)
Telegram Group Manager Bot + Userbot Written In Python Using Pyrogram.

Telegram Group Manager Bot + Userbot Written In Python Using PyrogramTelegram Group Manager Bot + Userbot Written In Python Using Pyrogram

1 Nov 11, 2021
Tiktok 2 Instagram With Python

Tiktok2Instagram 📸 About The Project What it does: Download the source video from a user inputted Tiktok URL. 📙 Add audio to the Tiktok video from a

Carter Belisle 4 Feb 06, 2022
❄️ Don't waste your money paying for new tokens, once you have used your tokens, clean them up and resell them!

TokenCleaner Don't waste your money paying for new tokens, once you have used your tokens, clean them up and resell them! If you have a very large qua

0xVichy 59 Nov 14, 2022
A template that help you getting started with Pycord.

A Pycord Template with some example! Getting Started: Clone this repository using git clone https://github.com/AungS8430/pycord-template.git If you ha

2 Feb 10, 2022
Automation for grabbing keys from a Linux host. Useful during red team exercises to quickly help assess what access to a Linux host can lead to.

keygrabber Automation for grabbing keys from a Linux host. This can be helpful during red team exercises when you gain access to a Linux host and want

Cedric Owens 14 Sep 27, 2022
Leveraged grid-trading bot using CCXT/CCXT Pro library in FTX exchange.

Leveraged-grid-trading-bot The code is designed to perform infinity grid trading strategy in FTX exchange. The basic trader named Gridtrader.py contro

Hao-Liang Wen 25 Oct 07, 2021
The most Advanced yet simple Multi Cloud tool to transfer Your Data from any cloud to any cloud remotely based on Rclone.⚡

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

Dr.Caduceus 162 Jan 08, 2023
Robot Swerve Test Public With Python

Robot-Swerve-Test-Public The codebase for our swerve drivetrain prototype robot.

1 Jan 09, 2022
A community made discord bot coded in Python and running on AWS.

Pogbot Project Open Group Discord This is an open source community ran project. Join the discord for more information on how to participate. Coded in

Project Open Group 2 Jul 27, 2022
Bifrost C2. Open-source post-exploitation using Discord API

Bifrost Command and Control What's Bifrost? Bifrost is an open-source Discord BOT that works as Command and Control (C2). This C2 uses Discord API for

38 Dec 05, 2022
Async ShareX uploader written in python

Async ShareX uploader written in python

Jacob 2 Jan 07, 2022
AWS Enumeration and Footprinting Tool

Quiet Riot 🎶 C'mon, Feel The Noise 🎶 An enumeration tool for scalable, unauthenticated validation of AWS principals; including AWS Acccount IDs, roo

Wes Ladd 89 Jan 05, 2023
Bot that embeds a random hysterical meme from Reddit into your text channel as an embedded message, using an API call.

Discord_Meme_Bot 🤣 Bot that embeds a random hysterical meme from Reddit into your text channel as an embedded message, using an API call. Add the bot

2 Jan 16, 2022
this synchronizes my appearances with my calendar

Josh's Schedule Synchronizer Here's the "problem:" I use a spreadsheet to maintain all my public appearances. I check the spreadsheet as often as poss

Josh Long 2 Oct 18, 2021
Date Time Userbot With Python

DATE_TIME_USERBOT An Telegram Bot By @Pythone_3 Config Vars API_ID : Telegram API_ID, get it from my.telegram.org/apps API_HASH : Telegram API_ID, get

Sinzz-sinan-m 2 Oct 20, 2021
YuuScource - A Discord bot made with Pycord

Yuu A Discord bot made with Pycord Features Not much lol • Easy to use commands

kekda 9 Feb 17, 2022
Python version of PlaceNL's headless bot with automatic access token refresh

Reddit /r/place 2022 headless bot This headless Python bot will automatically login to reddit, obtain access tokens (and refreshes them when they expi

19 May 21, 2022
SpaceManJax's open-source Discord Bot. Now on Github!

SpaceManBot This is SpaceManJax's open-source Discord.py Bot. Now on Github! This bot runs on Repl.it, which is a free online code editor. It can do a

Jack 1 Nov 16, 2021
Unit testing AWS interactions with pytest and moto. These examples demonstrate how to structure, setup, teardown, mock, and conduct unit testing. The source code is only intended to demonstrate unit testing.

Unit Testing Interactions with Amazon Web Services (AWS) Unit testing AWS interactions with pytest and moto. These examples demonstrate how to structu

AWS Samples 21 Nov 17, 2022
Gathers data and displays metrics related to climate change and resource depletion on a PowerBI report.

Apocalypse Status Dashboard Purpose Climate change and resource depletion are grave long-term dangers. The code in this repository will pull data from

Summer Is Here 1 Nov 12, 2021