This commit is contained in:
Tofik Denianto 2022-01-31 17:35:01 +07:00 committed by GitHub
parent ac41c4daa6
commit bb92e112fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,6 +12,8 @@ async def ytsearch(_, message: Message):
query = message.text.split(None, 1)[1] query = message.text.split(None, 1)[1]
m = await message.reply_text("🔎 **Searching...**") m = await message.reply_text("🔎 **Searching...**")
results = YoutubeSearch(query, max_results=5).to_dict() results = YoutubeSearch(query, max_results=5).to_dict()
if len(results) == 0:
return await m.edit_text("❌ **no results found.**")
text = "" text = ""
for i in range(5): for i in range(5):
try: try: