gTTS: (temporary?) fix for AttributeError: 'NoneType' object has no attribute 'group'

Found a fix (atleast temporary)

in gtts_token/gtts_token.py

remove lines

        tkk_expr = re.search(".*?(TKK=.*?;)W.*?", line).group(1)
        a = re.search("a\\\\x3d(-?\d+);", tkk_expr).group(1)
        b = re.search("b\\\\x3d(-?\d+);", tkk_expr).group(1)

        result = str(hours) + "." + str(int(a) + int(b))

replace them with line result = re.search("TKK='(.+?)';", line).group(1)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 3
  • Comments: 20

Most upvoted comments

Apparently pip update install gtts_token didn’t work. Try this one:

pip uninstall gtts_token pip install gtts_token

This should update the script to the latest version and it will just work.

gtts-token is install along with gTTS.

It is defined in setup.py line: 26