2020-03-30 07:58:00,639 (__init__.py:420 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. The server returned HTTP 401 Unauthorized. Response body:
[b'{"ok":false,"error_code":401,"description":"Unauthorized"}']"
Traceback (most recent call last):
File "D:\Grigorev\lib\site-packages\telebot\__init__.py", line 415, in __threaded_polling
polling_thread.raise_exceptions()
File "D:\Grigorev\lib\site-packages\telebot\util.py", line 79, in raise_exceptions
six.reraise(self.exc_info[0], self.exc_info[1], self.exc_info[2])
File "D:\Grigorev\lib\site-packages\six.py", line 703, in reraise
raise value
File "D:\Grigorev\lib\site-packages\telebot\util.py", line 60, in run
task(*args, **kwargs)
File "D:\Grigorev\lib\site-packages\telebot\__init__.py", line 279, in __retrieve_updates
updates = self.get_updates(offset=(self.last_update_id + 1), timeout=timeout)
File "D:\Grigorev\lib\site-packages\telebot\__init__.py", line 249, in get_updates
json_updates = apihelper.get_updates(self.token, offset, limit, timeout, allowed_updates)
File "D:\Grigorev\lib\site-packages\telebot\apihelper.py", line 194, in get_updates
return _make_request(token, method_url, params=payload)
File "D:\Grigorev\lib\site-packages\telebot\apihelper.py", line 60, in _make_request
return _check_result(method_name, result)['result']
File "D:\Grigorev\lib\site-packages\telebot\apihelper.py", line 79, in _check_result
raise ApiException(msg, method_name, result)
telebot.apihelper.ApiException: A request to the Telegram API was unsuccessful. The server returned HTTP 401 Unauthorized. Response body:
[b'{"ok":false,"error_code":401,"description":"Unauthorized"}']
A request to the Telegram API was unsuccessful. The server returned HTTP 401 Unauthorized.
а авторизация у нас по
bot = telebot.TeleBot(config.TOKEN) #в конфге токен
Проблема в том, что телега блокирована в России https://www.youtube.com/watch?v=CDFFfWOqVKs
вот тут объясняется как все это обойти.
Возможно придется перебрать несколько различных проксей, не все будут работать.