From 59b61451927feff8c9b7aa3e2b16f12e6f2b35d3 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Mon, 7 Feb 2022 12:09:06 +0700 Subject: [PATCH] func --- program/video.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/program/video.py b/program/video.py index 3d5555f..ae79778 100644 --- a/program/video.py +++ b/program/video.py @@ -4,7 +4,7 @@ import re import asyncio - +# repository stuff from config import BOT_USERNAME, IMG_1, IMG_2, IMG_5 from program.utils.inline import stream_markup from driver.design.thumbnail import thumb @@ -13,9 +13,12 @@ from driver.filters import command, other_filters from driver.queues import QUEUE, add_to_queue from driver.veez import call_py, user from driver.database.dbpunish import is_gbanned_user +# pyrogram stuff from pyrogram import Client from pyrogram.errors import UserAlreadyParticipant, UserNotParticipant from pyrogram.types import InlineKeyboardMarkup, Message +# py-tgcalls stuff +from pytgcalls import idle from pytgcalls import StreamType from pytgcalls.types.input_stream import AudioVideoPiped from pytgcalls.types.input_stream.quality import ( @@ -24,6 +27,7 @@ from pytgcalls.types.input_stream.quality import ( LowQualityVideo, MediumQualityVideo, ) +# youtube-dl stuff from youtubesearchpython import VideosSearch @@ -200,6 +204,7 @@ async def vplay(c: Client, m: Message): reply_markup=InlineKeyboardMarkup(buttons), caption=f"🗂 **Name:** [{songname}]({link}) | `video`\n⏱️ **Duration:** `{duration}`\n🧸 **Request by:** {requester}", ) + await idle() else: if len(m.command) < 2: await m.reply( @@ -260,6 +265,7 @@ async def vplay(c: Client, m: Message): reply_markup=InlineKeyboardMarkup(buttons), caption=f"🗂 **Name:** [{songname}]({url}) | `video`\n⏱ **Duration:** `{duration}`\n🧸 **Request by:** {requester}", ) + await idle() except Exception as ep: await loser.delete() await m.reply_text(f"🚫 error: `{ep}`") @@ -324,6 +330,7 @@ async def vplay(c: Client, m: Message): reply_markup=InlineKeyboardMarkup(buttons), caption=f"🗂 **Name:** [{songname}]({url}) | `video`\n⏱ **Duration:** `{duration}`\n🧸 **Request by:** {requester}", ) + await idle() except Exception as ep: await loser.delete() await m.reply_text(f"🚫 error: `{ep}`")