send link for videos that are too large

This commit is contained in:
bakatrouble 2023-05-13 04:38:55 +03:00
parent c7c469c8a3
commit 0f4d779e0c

18
main.py
View File

@ -63,13 +63,17 @@ async def check_updates():
file.name = f'file.{post.file.ext}'
file.seek(0)
if post.file.ext == 'webm':
await bot.send_video(int(os.environ['SEND_CHAT']),
file,
width=post.file.width,
height=post.file.height,
thumb=post.preview.url,
caption=caption,
parse_mode=ParseMode.HTML)
if post.file.size < 50_000_000:
await bot.send_video(int(os.environ['SEND_CHAT']),
file,
width=post.file.width,
height=post.file.height,
thumb=post.preview.url,
caption=caption,
parse_mode=ParseMode.HTML)
else:
await bot.send_message(int(os.environ['SEND_CHAT']),
f'File is too large: {post.file.url}\n\n' + caption)
elif post.file.ext == 'gif':
await bot.send_animation(int(os.environ['SEND_CHAT']),
file,