H
H
hpmalo2018-05-03 16:09:40
Python
hpmalo, 2018-05-03 16:09:40

How to bypass telegram blocking?

raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: SOCKSHTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /bot577218600:AAGQNIaPkdTpWQJUN8DhLmlIb8-0UvMaiXM/getUpdates?offset=1&timeout =20 (Caused by ConnectTimeoutError(, 'Connection to api.telegram.org timed out. (connect timeout=3.5)'))
I started writing a telegram bot and I can't do a check when running it on my computer. In the future, I will transfer the bot to a non-Russian server and there will be no problems. Now I need to check what I write

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Semenenko, 2018-05-03
@hpmalo

#Like this, in the code:
from telebot import apihelper
apihelper.proxy = {'https': 'socks5://xxx.xxx.xxx.xxx:yyyy'}
#xxx - ip, yyyy - port
Before that, you need to set requests[ socks], I have on ubuntu 16.04:
sudo pip3.6 install -U requests[socks]
But this breaks the work of CAPS (printers on ubuntu 16.04), but the proxy worked. On windows should not break anything.

U
Uno, 2018-05-03
@Noizefan


Throw any freeopenvpn.org through
vpn

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question