From 2d5e9ce8381c1faad079abfc62d83717377274ec Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Tue, 25 Jan 2022 20:23:55 +0700 Subject: [PATCH] add duration info for local video --- program/video.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/program/video.py b/program/video.py index 746db9e..7fb19e2 100644 --- a/program/video.py +++ b/program/video.py @@ -135,8 +135,10 @@ async def vplay(c: Client, m: Message): try: if replied.video: songname = replied.video.file_name[:70] + duration = replied.video.duration elif replied.document: songname = replied.document.file_name[:70] + duration = replied.document.duration except BaseException: songname = "Video" @@ -148,7 +150,7 @@ async def vplay(c: Client, m: Message): await m.reply_photo( photo=f"{IMG_1}", reply_markup=InlineKeyboardMarkup(buttons), - caption=f"💡 **Track added to queue »** `{pos}`\n\n🗂 **Name:** [{songname}]({link}) | `video`\n💭 **Chat:** `{chat_id}`\n🧸 **Request by:** {requester}", + caption=f"💡 **Track added to queue »** `{pos}`\n\n🗂 **Name:** [{songname}]({link}) | `video`\n⏱️ **Duration:** `{duration}`\n🧸 **Request by:** {requester}", ) else: if Q == 720: @@ -174,7 +176,7 @@ async def vplay(c: Client, m: Message): await m.reply_photo( photo=f"{IMG_2}", reply_markup=InlineKeyboardMarkup(buttons), - caption=f"🗂 **Name:** [{songname}]({link}) | `video`\n💭 **Chat:** `{chat_id}`\n🧸 **Request by:** {requester}", + caption=f"🗂 **Name:** [{songname}]({link}) | `video`\n⏱️ **Duration:** `{duration}`\n🧸 **Request by:** {requester}", ) else: if len(m.command) < 2: