B
B
Bot2282018-05-07 11:39:09
Python
Bot228, 2018-05-07 11:39:09

Bot crashes due to HTTPSConnectionPool(host='api.telegram.org', port=443): Read timed out error. (read timeout=30).How to fix?

The bot has this
while True:
try:
bot.polling(none_stop=True)
except Exception as e:
logger.error(e)
time.sleep(15)
5af0116276e92644888720.png

Answer the question

In order to leave comments, you need to log in

5 answer(s)
F
Fixid, 2018-05-07
@Fixid

Use a proxy

S
Semyon Novikov, 2018-05-07
@semennovikov123

There are two options, the first is because of the Russian IP, the second is because of the bad Internet (or not stable).
For the first option, you need to use Proxy or VPN . VPN must be configured so that all traffic from the computer goes through the VPN. I use CyberGhost. Make sure that the VPN is not too slow, otherwise users do not like to wait for an answer for a long time)

A
Alex F, 2018-05-07
@delvin-fil

For TOR:

import requests
proxies = {
    'http': 'socks5://localhost:9050',
    'https': 'socks5://localhost:9050'
}
url = "api.telegram.org"
out = requests.get(url, proxies=proxies).text

In your case, a little different, but the meaning is the same.

N
Nick, 2018-05-08
@zdrzhn

I have bots on Heroku, ip - USA
Choate does not save, this cart falls off periodically in theory

A
Alex Meyer, 2018-05-08
@iriddy

Use webhooks
Instruction

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question