Answer the question
In order to leave comments, you need to log in
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)
Answer the question
In order to leave comments, you need to log in
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)
For TOR:
import requests
proxies = {
'http': 'socks5://localhost:9050',
'https': 'socks5://localhost:9050'
}
url = "api.telegram.org"
out = requests.get(url, proxies=proxies).text
I have bots on Heroku, ip - USA
Choate does not save, this cart falls off periodically in theory
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question