GoogleFreeTrans icon indicating copy to clipboard operation
GoogleFreeTrans copied to clipboard

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

Open whale3070 opened this issue 2 years ago • 0 comments

$ pip install GoogleFreeTrans

Python 3.11.4 (tags/v3.11.4:d2340ef, Jun 7 2023, 05:45:37) [MSC v.1934 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

from GoogleFreeTrans import Translator translator = Translator.translator(src='en', dest='fr') Traceback (most recent call last): File "", line 1, in File "C:\Users\whale\AppData\Local\Programs\Python\Python311\Lib\site-packages\GoogleFreeTrans\Translator.py", line 96, in init self.__updata_tk() File "C:\Users\whale\AppData\Local\Programs\Python\Python311\Lib\site-packages\GoogleFreeTrans\Translator.py", line 110, in __updata_tk self.__TK = CalcTk() ^^^^^^^^ File "C:\Users\whale\AppData\Local\Programs\Python\Python311\Lib\site-packages\GoogleFreeTrans\CalcTk.py", line 7, in init self.tkk = gettkk.get_tkk() #从服务器获取TKK ^^^^^^^^^^^^^^^^ File "C:\Users\whale\AppData\Local\Programs\Python\Python311\Lib\site-packages\GoogleFreeTrans\gettkk.py", line 27, in get_tkk tkk = re.search(r'tkk:'(\d+.\d+)?'', res.text).group(1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'group' translator = Translator.translator(src='en', dest='zh-CN') Traceback (most recent call last): File "", line 1, in File "C:\Users\whale\AppData\Local\Programs\Python\Python311\Lib\site-packages\GoogleFreeTrans\Translator.py", line 96, in init self.__updata_tk() File "C:\Users\whale\AppData\Local\Programs\Python\Python311\Lib\site-packages\GoogleFreeTrans\Translator.py", line 110, in __updata_tk self.__TK = CalcTk() ^^^^^^^^ File "C:\Users\whale\AppData\Local\Programs\Python\Python311\Lib\site-packages\GoogleFreeTrans\CalcTk.py", line 7, in init self.tkk = gettkk.get_tkk() #从服务器获取TKK ^^^^^^^^^^^^^^^^ File "C:\Users\whale\AppData\Local\Programs\Python\Python311\Lib\site-packages\GoogleFreeTrans\gettkk.py", line 27, in get_tkk tkk = re.search(r'tkk:'(\d+.\d+)?'', res.text).group(1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'group'

whale3070 avatar Jan 07 '24 09:01 whale3070