Добрый день.
Помогите, пожалуйста, разобраться с отправкой сообщений в ТГ используя PROXY
Мой код ниже
import telebot
from telebot import apihelper
apihelper.proxy = {'https':'socks5://login:pass@ip:port'}
TOKEN = 'token'
bot = telebot.TeleBot(TOKEN)
id_group_chat = -123
msg = 'test'
def sent_to_telegram(msg):
bot.send_message(id_group_chat, msg, parse_mode='HTML')
sent_to_telegram(msg)
При выполнении кода возникает ошибка:
Traceback (most recent call last):
File "C:/Users/Матвей/PycharmProjects/motya/sent_to_telegram.py", line 25, in <module>
sent_to_telegram(msg)
File "C:/Users/Матвей/PycharmProjects/motya/sent_to_telegram.py", line 23, in sent_to_telegram
bot.send_message(id_group_chat, msg, parse_mode='HTML')
File "C:\Users\Матвей\PycharmProjects\motya\venv\lib\site-packages\telebot\__init__.py", line 598, in send_message
reply_markup, parse_mode, disable_notification))
File "C:\Users\Матвей\PycharmProjects\motya\venv\lib\site-packages\telebot\apihelper.py", line 140, in send_message
return _make_request(token, method_url, params=payload, method='post')
File "C:\Users\Матвей\PycharmProjects\motya\venv\lib\site-packages\telebot\apihelper.py", line 54, in _make_request
timeout=(connect_timeout, read_timeout), proxies=proxy)
File "C:\Users\Матвей\PycharmProjects\motya\venv\lib\site-packages\requests\sessions.py", line 465, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\Матвей\PycharmProjects\motya\venv\lib\site-packages\requests\sessions.py", line 573, in send
r = adapter.send(request, **kwargs)
File "C:\Users\Матвей\PycharmProjects\motya\venv\lib\site-packages\requests\adapters.py", line 337, in send
conn = self.get_connection(request.url, proxies)
File "C:\Users\Матвей\PycharmProjects\motya\venv\lib\site-packages\requests\adapters.py", line 245, in get_connection
proxy_manager = self.proxy_manager_for(proxy)
File "C:\Users\Матвей\PycharmProjects\motya\venv\lib\site-packages\requests\adapters.py", line 155, in proxy_manager_for
**proxy_kwargs)
File "C:\Users\Матвей\PycharmProjects\motya\venv\lib\site-packages\requests\packages\urllib3\poolmanager.py", line 280, in proxy_from_url
return ProxyManager(proxy_url=url, **kw)
File "C:\Users\Матвей\PycharmProjects\motya\venv\lib\site-packages\requests\packages\urllib3\poolmanager.py", line 231, in __init__
'Not supported proxy scheme %s' % proxy.scheme
AssertionError: Not supported proxy scheme socks5