treewide: some fixes & improvements

This commit is contained in:
levina 2022-02-24 09:39:12 +07:00 committed by GitHub
parent b651e773b4
commit 937d6ed47a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,7 +23,6 @@ from pyrogram import Client
from pyrogram.errors import UserAlreadyParticipant, UserNotParticipant from pyrogram.errors import UserAlreadyParticipant, UserNotParticipant
from pyrogram.types import InlineKeyboardMarkup, Message from pyrogram.types import InlineKeyboardMarkup, Message
from pytgcalls import idle
from pytgcalls import StreamType from pytgcalls import StreamType
from pytgcalls.types.input_stream import AudioPiped from pytgcalls.types.input_stream import AudioPiped
from pytgcalls.types.input_stream.quality import HighQualityAudio from pytgcalls.types.input_stream.quality import HighQualityAudio
@ -56,7 +55,6 @@ def ytsearch(query: str):
print(e) print(e)
return 0 return 0
async def ytdl(link: str): async def ytdl(link: str):
stdout, stderr = await bash( stdout, stderr = await bash(
f'yt-dlp --geo-bypass -g -f "best[height<=?720][width<=?1280]/best" {link}' f'yt-dlp --geo-bypass -g -f "best[height<=?720][width<=?1280]/best" {link}'
@ -169,7 +167,6 @@ async def play_tg_file(c: Client, m: Message, replied: Message = None, link: str
f"⏱️ **Duration:** `{duration}`\n" f"⏱️ **Duration:** `{duration}`\n"
f"🧸 **Request by:** {requester}", f"🧸 **Request by:** {requester}",
) )
await idle()
remove_if_exists(image) remove_if_exists(image)
except (NoActiveGroupCall, GroupCallNotFound): except (NoActiveGroupCall, GroupCallNotFound):
await suhu.delete() await suhu.delete()
@ -296,7 +293,6 @@ async def play(c: Client, m: Message):
reply_markup=InlineKeyboardMarkup(buttons), reply_markup=InlineKeyboardMarkup(buttons),
caption=f"🗂 **Name:** [{songname}]({url}) | `music`\n**⏱ Duration:** `{duration}`\n🧸 **Request by:** {requester}", caption=f"🗂 **Name:** [{songname}]({url}) | `music`\n**⏱ Duration:** `{duration}`\n🧸 **Request by:** {requester}",
) )
await idle()
remove_if_exists(image) remove_if_exists(image)
except (NoActiveGroupCall, GroupCallNotFound): except (NoActiveGroupCall, GroupCallNotFound):
await suhu.delete() await suhu.delete()
@ -371,7 +367,6 @@ async def play(c: Client, m: Message):
reply_markup=InlineKeyboardMarkup(buttons), reply_markup=InlineKeyboardMarkup(buttons),
caption=f"🗂 **Name:** [{songname}]({url}) | `music`\n**⏱ Duration:** `{duration}`\n🧸 **Request by:** {requester}", caption=f"🗂 **Name:** [{songname}]({url}) | `music`\n**⏱ Duration:** `{duration}`\n🧸 **Request by:** {requester}",
) )
await idle()
remove_if_exists(image) remove_if_exists(image)
except (NoActiveGroupCall, GroupCallNotFound): except (NoActiveGroupCall, GroupCallNotFound):
await suhu.delete() await suhu.delete()