added thumbnail support
This commit is contained in:
parent
fd794f7b73
commit
587a3b62c9
@ -6,6 +6,7 @@ import re
|
||||
import asyncio
|
||||
|
||||
from config import ASSISTANT_NAME, BOT_USERNAME, IMG_1, IMG_2
|
||||
from driver.design.thumbnail import thumb
|
||||
from driver.filters import command, other_filters
|
||||
from driver.queues import QUEUE, add_to_queue
|
||||
from driver.veez import call_py, user
|
||||
@ -165,9 +166,14 @@ async def play(c: Client, m: Message):
|
||||
await suhu.edit("❌ **no results found.**")
|
||||
else:
|
||||
songname = search[0]
|
||||
title = search[0]
|
||||
url = search[1]
|
||||
duration = search[2]
|
||||
thumbnail = search[3]
|
||||
userid = m.from_user.id
|
||||
gcname = m.chat.title
|
||||
ctitle = await CHAT_TITLE(gcname)
|
||||
image = await thumb(thumbnail, title, userid, ctitle)
|
||||
format = "bestaudio[ext=m4a]"
|
||||
veez, ytlink = await ytdl(format, url)
|
||||
if veez == 0:
|
||||
@ -180,7 +186,7 @@ async def play(c: Client, m: Message):
|
||||
await suhu.delete()
|
||||
requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
|
||||
await m.reply_photo(
|
||||
photo=thumbnail,
|
||||
photo=image,
|
||||
caption=f"💡 **Track added to queue »** `{pos}`\n\n🏷 **Name:** [{songname}]({url}) | `music`\n**⏱ Duration:** `{duration}`\n🎧 **Request by:** {requester}",
|
||||
reply_markup=keyboard,
|
||||
)
|
||||
@ -198,7 +204,7 @@ async def play(c: Client, m: Message):
|
||||
await suhu.delete()
|
||||
requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
|
||||
await m.reply_photo(
|
||||
photo=thumbnail,
|
||||
photo=image,
|
||||
caption=f"🏷 **Name:** [{songname}]({url})\n**⏱ Duration:** `{duration}`\n💡 **Status:** `Playing`\n🎧 **Request by:** {requester}\n📹 **Stream type:** `Music`",
|
||||
reply_markup=keyboard,
|
||||
)
|
||||
@ -219,9 +225,14 @@ async def play(c: Client, m: Message):
|
||||
await suhu.edit("❌ **no results found.**")
|
||||
else:
|
||||
songname = search[0]
|
||||
title = search[0]
|
||||
url = search[1]
|
||||
duration = search[2]
|
||||
thumbnail = search[3]
|
||||
userid = m.from_user.id
|
||||
gcname = m.chat.title
|
||||
ctitle = await CHAT_TITLE(gcname)
|
||||
image = await thumb(thumbnail, title, userid, ctitle)
|
||||
format = "bestaudio[ext=m4a]"
|
||||
veez, ytlink = await ytdl(format, url)
|
||||
if veez == 0:
|
||||
@ -234,7 +245,7 @@ async def play(c: Client, m: Message):
|
||||
f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
|
||||
)
|
||||
await m.reply_photo(
|
||||
photo=thumbnail,
|
||||
photo=image,
|
||||
caption=f"💡 **Track added to queue »** `{pos}`\n\n🏷 **Name:** [{songname}]({url}) | `music`\n**⏱ Duration:** `{duration}`\n🎧 **Request by:** {requester}",
|
||||
reply_markup=keyboard,
|
||||
)
|
||||
@ -252,7 +263,7 @@ async def play(c: Client, m: Message):
|
||||
await suhu.delete()
|
||||
requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
|
||||
await m.reply_photo(
|
||||
photo=thumbnail,
|
||||
photo=image,
|
||||
caption=f"🏷 **Name:** [{songname}]({url})\n**⏱ Duration:** `{duration}`\n💡 **Status:** `Playing`\n🎧 **Request by:** {requester}\n📹 **Stream type:** `Music`",
|
||||
reply_markup=keyboard,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user