Всем привет, столкнулся со следующей проблемой: C:\Users\PC\AppData\Local\Programs\Python\Python37-32\lib\site-packages\telegram\vendor\ptb_urllib3\urllib3\connectionpool.py:865: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning) Code C:\Users\PC\AppData\Local\Programs\Python\Python37-32\lib\site-packages\telegram\vendor\ptb_urllib3\urllib3\connectionpool.py:865: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning) Почти 4 часа ковыряюсь, ничего так и не получилось :( Знатоки, помогите Код: # -*- coding: utf-8 -*- from telegram.ext import Updater, CommandHandler, MessageHandler, Filters REQUEST_KWARGS={ 'proxy_url': 'socks4://171.103.9.22:4145/', 'urllib3_proxy_kwargs': { 'assert_hostname': 'False', 'cert_reqs': 'CERT_NONE' } } updater = Updater(token='', use_context=True, request_kwargs=REQUEST_KWARGS) dispatcher = updater.dispatcher def startCommand(bot, update): bot.send_message(chat_id=update.message.chat_id, text='Как жизнь?') def textMessage(bot, update): response = 'Получено сообщение -> ' + update.message.text bot.send_message(chat_id=update.message.chat_id, text=response) start_command_handler = CommandHandler('start', startCommand) text_message_handler = MessageHandler(Filters.text, textMessage) dispatcher.add_handler(start_command_handler) dispatcher.add_handler(text_message_handler) updater.start_polling(clean=True) updater.idle() Code # -*- coding: utf-8 -*- from telegram.ext import Updater, CommandHandler, MessageHandler, Filters REQUEST_KWARGS={ 'proxy_url': 'socks4://171.103.9.22:4145/', 'urllib3_proxy_kwargs': { 'assert_hostname': 'False', 'cert_reqs': 'CERT_NONE' } } updater = Updater(token='', use_context=True, request_kwargs=REQUEST_KWARGS) dispatcher = updater.dispatcher def startCommand(bot, update): bot.send_message(chat_id=update.message.chat_id, text='Как жизнь?') def textMessage(bot, update): response = 'Получено сообщение -> ' + update.message.text bot.send_message(chat_id=update.message.chat_id, text=response) start_command_handler = CommandHandler('start', startCommand) text_message_handler = MessageHandler(Filters.text, textMessage) dispatcher.add_handler(start_command_handler) dispatcher.add_handler(text_message_handler) updater.start_polling(clean=True) updater.idle() P.S.: (Это не помогает) import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) Code import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) Code import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
ты *** хоть на хосте врубил? The post was merged to previous Dec 14, 2019 если это не из-за ***, то не помогу, тк. этот питон идёт нахуй
MaH9aPuH, садись, пять The post was merged to previous Dec 15, 2019 anonymous228, пытался, не получилось, отрезки кода тоже прикрепил, есть идеи, как можно ещё отключить проверку?
anonymous228, я понял, пытался 2-мя способами import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) Code import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) Code import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) Не помогло, какие ещё есть варианты?
ItzDuster1, Телеграм не работает на территории РФ. Именно поэтому бота держать на территории РФ не получится. Советую использовать *** сервис или ставить бота на зарубежный хостинг