title: python telethon ConnectionError: Connection to Telegram failed 5 time(s)
body: <p>I'm trying to get every new message sent in a channel with python and then use the data to do some further processing. This is my code:</p>
  <pre><code>api_id = *******
  api_hash = '**********************'
  
  client = TelegramClient(
      'session_name',
      api_id,
      api_hash,
  
  )
  client.start()
  print(client.get_me().stringify())
  client.send_message('someone', 'Hello! Talking to you from Telethon')
  
  </code></pre>
  <p>And this is the error that I get:</p>
  <pre><code>
  C:\Users\erfan\AppData\Local\Programs\Python\Python39\python.exe &quot;C:/Users/erfan/Desktop/Boors py/main.py&quot;
  Traceback (most recent call last):
    File &quot;C:\Users\erfan\Desktop\Boors py\main.py&quot;, line 14, in &lt;module&gt;
      client.start()
    File &quot;C:\Users\erfan\AppData\Local\Programs\Python\Python39\lib\site-packages\telethon\client\auth.py&quot;, line 133, in start
      else self.loop.run_until_complete(coro)
    File &quot;C:\Users\erfan\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py&quot;, line 642, in run_until_complete
      return future.result()
    File &quot;C:\Users\erfan\AppData\Local\Programs\Python\Python39\lib\site-packages\telethon\client\auth.py&quot;, line 140, in _start
      await self.connect()
    File &quot;C:\Users\erfan\AppData\Local\Programs\Python\Python39\lib\site-packages\telethon\client\telegrambaseclient.py&quot;, line 516, in connect
      if not await self._sender.connect(self._connection(
    File &quot;C:\Users\erfan\AppData\Local\Programs\Python\Python39\lib\site-packages\telethon\network\mtprotosender.py&quot;, line 123, in connect
      await self._connect()
    File &quot;C:\Users\erfan\AppData\Local\Programs\Python\Python39\lib\site-packages\telethon\network\mtprotosender.py&quot;, line 249, in _connect
      raise ConnectionError('Connection to Telegram failed {} time(s)'.format(self._retries))
  ConnectionError: Connection to Telegram failed 5 time(s)
  
  Process finished with exit code 1
  
  </code></pre>
  <p>Telegram is blocked by my country. So I use Lantern to have access to it and I can access web.telegram.com. I also tried using a mtproxy but got the same error.</p>