-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Sometimes timeout error appears when i'm trying send medium size video files (~25mb)
Traceback (most recent call last): await self.bot.send_video(chat_id, media_item, caption=caption) File "/usr/local/lib/python3.10/site-packages/telebot/async_telebot.py", line 3153, in send_video await asyncio_helper.send_video( File "/usr/local/lib/python3.10/site-packages/telebot/asyncio_helper.py", line 713, in send_video return await _process_request(token, method_url, params=payload, files=files, method='post') File "/usr/local/lib/python3.10/site-packages/telebot/asyncio_helper.py", line 105, in _process_request raise RequestTimeout("Request timeout. Request: method={0} url={1} params={2} files={3} request_timeout={4}".format(method, url, params, files, request_timeout, current_try)) telebot.asyncio_helper.RequestTimeout: Request timeout. Request: method=post url=sendVideo params=<aiohttp.formdata.FormData object at 0x7fb17c0d25f0> files={'video': <telebot.types.InputMediaVideo object at 0x7fb17c0d1e10>} request_timeout=300
download video method
dbytes, dsize = await self.__download_file(media_url, session)
InputMediaVideo(dbytes)
async def __download_file(self, url, session):
web_data = await session.get(url)
data_bytes = await web_data.content.read()
size = len(data_bytes)
return data_bytes, size
-
What version of pyTelegramBotAPI are you using?
4.13 -
What OS are you using?
Linux, Ubuntu -
What version of python are you using?
3.10