From 4afde9f5577227d7e5cdfe5cf78f43f98cc0ea0c Mon Sep 17 00:00:00 2001 From: Aragroth <51192359+Aragroth@users.noreply.github.com> Date: Thu, 2 Jul 2020 17:46:41 +0300 Subject: [PATCH 1/5] Update apihelper.py --- telebot/apihelper.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/telebot/apihelper.py b/telebot/apihelper.py index c4ab906..e7a3df5 100644 --- a/telebot/apihelper.py +++ b/telebot/apihelper.py @@ -53,8 +53,8 @@ def _make_request(token, method_name, method='get', params=None, files=None): request_url = API_URL.format(token, method_name) logger.debug("Request: method={0} url={1} params={2} files={3}".format(method, request_url, params, files)) - read_timeout = READ_TIMEOUT - connect_timeout = CONNECT_TIMEOUT + read_timeout = READ_TIMEOUT + 70 * 2 + connect_timeout = CONNECT_TIMEOUT + 70 * 2 if files and format_header_param: fields.format_header_param = _no_encode(format_header_param) if params: @@ -435,7 +435,7 @@ def send_chat_action(token, chat_id, action, timeout=None): def send_video(token, chat_id, data, duration=None, caption=None, reply_to_message_id=None, reply_markup=None, - parse_mode=None, supports_streaming=None, disable_notification=None, timeout=None, thumb=None): + parse_mode=None, supports_streaming=None, disable_notification=None, timeout=None, thumb=None, width=None, height=None): method_url = r'sendVideo' payload = {'chat_id': chat_id} files = None @@ -464,6 +464,10 @@ def send_video(token, chat_id, data, duration=None, caption=None, reply_to_messa files['thumb'] = thumb else: payload['thumb'] = thumb + if width: + payload['width'] = width + if height: + payload['height'] = height return _make_request(token, method_url, params=payload, files=files, method='post') From a69a358ebd9e9f5616813bbce58bd213dfa2268c Mon Sep 17 00:00:00 2001 From: Aragroth <51192359+Aragroth@users.noreply.github.com> Date: Thu, 2 Jul 2020 17:47:38 +0300 Subject: [PATCH 2/5] Update __init__.py --- telebot/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telebot/__init__.py b/telebot/__init__.py index c182463..b24013b 100644 --- a/telebot/__init__.py +++ b/telebot/__init__.py @@ -772,7 +772,7 @@ class TeleBot: disable_notification, timeout)) def send_video(self, chat_id, data, duration=None, caption=None, reply_to_message_id=None, reply_markup=None, - parse_mode=None, supports_streaming=None, disable_notification=None, timeout=None, thumb=None): + parse_mode=None, supports_streaming=None, disable_notification=None, timeout=None, thumb=None, width=None, height=None): """ Use this method to send video files, Telegram clients support mp4 videos. :param chat_id: Integer : Unique identifier for the message recipient — User or GroupChat id @@ -790,7 +790,7 @@ class TeleBot: """ return types.Message.de_json( apihelper.send_video(self.token, chat_id, data, duration, caption, reply_to_message_id, reply_markup, - parse_mode, supports_streaming, disable_notification, timeout, thumb)) + parse_mode, supports_streaming, disable_notification, timeout, thumb, width, height)) def send_animation(self, chat_id, animation, duration=None, caption=None, reply_to_message_id=None, reply_markup=None, parse_mode=None, disable_notification=None, timeout=None): From f83f69ed50f0c53bb8539fd5167c822f51284117 Mon Sep 17 00:00:00 2001 From: Aragroth <51192359+Aragroth@users.noreply.github.com> Date: Thu, 2 Jul 2020 17:50:14 +0300 Subject: [PATCH 3/5] Update apihelper.py --- telebot/apihelper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telebot/apihelper.py b/telebot/apihelper.py index e7a3df5..07ae8f8 100644 --- a/telebot/apihelper.py +++ b/telebot/apihelper.py @@ -53,8 +53,8 @@ def _make_request(token, method_name, method='get', params=None, files=None): request_url = API_URL.format(token, method_name) logger.debug("Request: method={0} url={1} params={2} files={3}".format(method, request_url, params, files)) - read_timeout = READ_TIMEOUT + 70 * 2 - connect_timeout = CONNECT_TIMEOUT + 70 * 2 + read_timeout = READ_TIMEOUT + connect_timeout = CONNECT_TIMEOUT if files and format_header_param: fields.format_header_param = _no_encode(format_header_param) if params: From f4d978cd980dd593eca08481754fb0769022ef9c Mon Sep 17 00:00:00 2001 From: Aragroth <51192359+Aragroth@users.noreply.github.com> Date: Thu, 2 Jul 2020 17:51:34 +0300 Subject: [PATCH 4/5] Update apihelper.py --- telebot/apihelper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telebot/apihelper.py b/telebot/apihelper.py index 07ae8f8..e7a3df5 100644 --- a/telebot/apihelper.py +++ b/telebot/apihelper.py @@ -53,8 +53,8 @@ def _make_request(token, method_name, method='get', params=None, files=None): request_url = API_URL.format(token, method_name) logger.debug("Request: method={0} url={1} params={2} files={3}".format(method, request_url, params, files)) - read_timeout = READ_TIMEOUT - connect_timeout = CONNECT_TIMEOUT + read_timeout = READ_TIMEOUT + 70 * 2 + connect_timeout = CONNECT_TIMEOUT + 70 * 2 if files and format_header_param: fields.format_header_param = _no_encode(format_header_param) if params: From 7c94eee3a23f0edbca3ad83ebbbef1a3bd860f62 Mon Sep 17 00:00:00 2001 From: Aragroth <51192359+Aragroth@users.noreply.github.com> Date: Sat, 11 Jul 2020 20:09:48 +0300 Subject: [PATCH 5/5] Update apihelper.py --- telebot/apihelper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telebot/apihelper.py b/telebot/apihelper.py index e7a3df5..07ae8f8 100644 --- a/telebot/apihelper.py +++ b/telebot/apihelper.py @@ -53,8 +53,8 @@ def _make_request(token, method_name, method='get', params=None, files=None): request_url = API_URL.format(token, method_name) logger.debug("Request: method={0} url={1} params={2} files={3}".format(method, request_url, params, files)) - read_timeout = READ_TIMEOUT + 70 * 2 - connect_timeout = CONNECT_TIMEOUT + 70 * 2 + read_timeout = READ_TIMEOUT + connect_timeout = CONNECT_TIMEOUT if files and format_header_param: fields.format_header_param = _no_encode(format_header_param) if params: