title: googletrans python AttributeError: 'NoneType' object has no attribute 'group'
body: <p>So, I've prepared code like this:</p>
  <pre><code>async def cv_local(ctx, country=&quot;&quot;):
      translator = Translator()
      try:
          country = translator.translate(country, dest='en').text
          now = datetime.datetime.now()
          # startTime = time.time()
          if country == &quot;&quot;:
              country = &quot;world&quot;
              print(&quot;At &quot; + str(now.hour) + &quot;:&quot; + str(now.minute) + &quot; user &quot; + str(ctx.message.author.name) + &quot;(Id: &quot; + str(
                  ctx.message.author.id) + &quot;)&quot; +
                    &quot; didn't mention any country, sent data for world&quot;)
          else:
              print(&quot;At &quot; + str(now.hour) + &quot;:&quot; + str(now.minute) + &quot; user &quot; + str(ctx.message.author.name) + &quot;(Id: &quot; + str(
                  ctx.message.author.id) + &quot;)&quot; + &quot; searched for: &quot; +
                    str(Library.exceptionCheck(country)[1]))
  
          if str(country).lower() == &quot;world&quot; or str(country).lower() == &quot;kw&quot; or str(country).lower() == &quot;za&quot;:
              url = 'https://www.worldometers.info/coronavirus/'
              code = Library.HttpsRead(url, &quot;świat&quot;, config[str(ctx.message.guild.id)]['lang'])
          else:
              temp1 = Library.exceptionCheck(country)[0]
              url = 'https://www.worldometers.info/coronavirus/country/' + temp1
              code = Library.HttpsRead(url, country, config[str(ctx.message.guild.id)]['lang'])
  
          message = await ctx.send(embed=code)
          await message.add_reaction(&quot;&quot;)
          # print(&quot;execution took %s seconds \n&quot; % (time.time() - startTime))
      except UnboundLocalError:
          await ctx.send(&quot;That's strange... It seems like you wanted data for country that doesn't exist in my database\nImportant message: if you would like to look for countries named with multiple words insert \&quot;-\&quot; instead of &quot;
                         &quot;spaces or use shortcuts f.e. \&quot;uk\&quot; instead of \&quot;United Kingdom\&quot; or \&quot;south-africa\&quot; instead of \&quot;South Africa\&quot;\n\n If error will be repeating report it to &lt;@!287258679609393152&gt;&quot;)
          print(&quot;Error occurred, user missed name of country&quot;)
          # print(&quot;execution took %s seconds \n&quot; % (time.time() - startTime))
      except:
          await ctx.send(&quot;That's strange... Translator occurred some kind of error\nJust try again and everything should be just fine\n\n If error will be repeating report it to &lt;@!287258679609393152&gt;&quot;)
          print(&quot;Error occurred, informed user&quot;)
          # print(&quot;execution took %s seconds \n&quot; % (time.time() - startTime))
  </code></pre>
  <p>It's discord bot, and everything used to work perfectly, but lately it started to crash more and more frequently, here's an error log:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;C:\Users\grzes\PycharmProjects\CoronaBot\venv\lib\site-packages\discord\ext\commands\core.py&quot;, line 85, in wrapped
      ret = await coro(*args, **kwargs)
    File &quot;C:/Users/grzes/PycharmProjects/CoronaBot/bot.py&quot;, line 222, in cv_local
      country = translator.translate(country, dest='en').text
    File &quot;C:\Users\grzes\PycharmProjects\CoronaBot\venv\lib\site-packages\googletrans-2.3.0-py3.8.egg\googletrans\client.py&quot;, line 172, in translate
      data = self._translate(text, dest, src)
    File &quot;C:\Users\grzes\PycharmProjects\CoronaBot\venv\lib\site-packages\googletrans-2.3.0-py3.8.egg\googletrans\client.py&quot;, line 75, in _translate
      token = self.token_acquirer.do(text)
    File &quot;C:\Users\grzes\PycharmProjects\CoronaBot\venv\lib\site-packages\googletrans-2.3.0-py3.8.egg\googletrans\gtoken.py&quot;, line 186, in do
      self._update()
    File &quot;C:\Users\grzes\PycharmProjects\CoronaBot\venv\lib\site-packages\googletrans-2.3.0-py3.8.egg\googletrans\gtoken.py&quot;, line 65, in _update
      code = unicode(self.RE_TKK.search(r.text).group(1)).replace('var ', '')
  AttributeError: 'NoneType' object has no attribute 'group'
  </code></pre>
  <p>I've read a little bit about it and tried few solutions from <a href="https://stackoverflow.com/questions/52455774/googletrans-stopped-working-with-error-nonetype-object-has-no-attribute-group/52487148#52487148">here</a>, but nothing seems to work for me, maybe it's different problem than this one? I've just got no idea what else to do, can anyone help with this?</p>
  <p>EDIT: added <code>os.environ[&quot;HTTPX_LOG_LEVEL&quot;] = &quot;DEBUG&quot;</code>
  And output is like this:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;C:\Users\grzes\PycharmProjects\CoronaBot\venv\lib\site-packages\discord\ext\commands\core.py&quot;, line 85, in wrapped
      ret = await coro(*args, **kwargs)
    File &quot;C:/Users/grzes/PycharmProjects/CoronaBot/bot.py&quot;, line 242, in cv_local
      code = Library.HttpsRead(url, country, config[str(ctx.message.guild.id)]['lang'])
    File &quot;C:\Users\grzes\PycharmProjects\CoronaBot\Library.py&quot;, line 221, in HttpsRead
      embed = discord.Embed(title=translator.translate(&quot;Dane o chorobie&quot;, dest=currLang).text, description=&quot;[Support bot](https://kickstarter.com), [vote](https://top.gg), [support me](https://patreon.com)&quot;, color=0xf00000)
    File &quot;C:\Users\grzes\PycharmProjects\CoronaBot\venv\lib\site-packages\googletrans-2.3.0-py3.8.egg\googletrans\client.py&quot;, line 172, in translate
      data = self._translate(text, dest, src)
    File &quot;C:\Users\grzes\PycharmProjects\CoronaBot\venv\lib\site-packages\googletrans-2.3.0-py3.8.egg\googletrans\client.py&quot;, line 75, in _translate
      token = self.token_acquirer.do(text)
    File &quot;C:\Users\grzes\PycharmProjects\CoronaBot\venv\lib\site-packages\googletrans-2.3.0-py3.8.egg\googletrans\gtoken.py&quot;, line 186, in do
      self._update()
    File &quot;C:\Users\grzes\PycharmProjects\CoronaBot\venv\lib\site-packages\googletrans-2.3.0-py3.8.egg\googletrans\gtoken.py&quot;, line 65, in _update
      code = unicode(self.RE_TKK.search(r.text).group(1)).replace('var ', '')
  AttributeError: 'NoneType' object has no attribute 'group'
  </code></pre>