Max Retry Exceeded With Url In Telegram Bot
I started writing a telegram bot in python. but when I run it after a while it returns an error: Exception in thread updater: Traceback (most recent call last): File '/usr/lib/py
Solution 1:
I was facing the same problem. What it actually means is that Telegram in this case is refusing your connection due to too many requests. Check it here (same question but with Itunes).
Try using a try-except to avoid this error message.
try:
page1 = #whatever codeexcept requests.exceptions.ConnectionError:
r.status_code = "Connection refused"
And most of it might be because you let it run but not write anything in the bot, so it goes "silent". If we "sleep" the program, that won't happen as empty requests won't be sent. Use sleep(timeinsec) function in python (don't forget to import sleep).
fromtime import sleep
Solution 2:
For me, just add "verify=False" as the last parameter in request:
requests.get(url, headers = {}, verify=False)
Post a Comment for "Max Retry Exceeded With Url In Telegram Bot"