telegraph
telegraph copied to clipboard
add socks5h support
hello, telegra.ph is blocked in our country, and we use proxy. So, please add support socks5h, like in https://github.com/python-telegram-bot/python-telegram-bot
REQUEST_KWARGS = {'proxy_url': 'socks5h://127.0.0.1:9050',} updater = Updater(token=TOKEN, request_kwargs=REQUEST_KWARGS, use_context=True)
It's using requests
under the hood, which supports socks5 proxies. I think you can set it via telegraph._telegraph.proxies
(also probably you need to pip install requests[socks]
)
Maybe we can allow to pass TelegraphApi
instance to Telegraph
via arg. And allow to pass requests
session to TelegraphApi
. PR is welcome
it's not working
telegraph._telegraph.proxies = dict(https='socks5h://localhost:9050') AttributeError: 'TelegraphApi' object has no attribute 'proxies'
oops, it's telegraph._telegraph.session.proxies
it's works, thanks! goodbye roskomndzor J
telegraph._telegraph.session.proxies = {'https':'socks5h://localhost:9050'}