added thumbnail support
This commit is contained in:
parent
a6f92660be
commit
26a6789c43
@ -6,6 +6,8 @@ import re
|
|||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
from config import ASSISTANT_NAME, BOT_USERNAME, IMG_1, IMG_2
|
from config import ASSISTANT_NAME, BOT_USERNAME, IMG_1, IMG_2
|
||||||
|
from driver.design.thumbnail import thumb
|
||||||
|
from driver.design.chatname import CHAT_TITLE
|
||||||
from driver.filters import command, other_filters
|
from driver.filters import command, other_filters
|
||||||
from driver.queues import QUEUE, add_to_queue
|
from driver.queues import QUEUE, add_to_queue
|
||||||
from driver.veez import call_py, user
|
from driver.veez import call_py, user
|
||||||
@ -197,9 +199,14 @@ async def vplay(c: Client, m: Message):
|
|||||||
await loser.edit("❌ **no results found.**")
|
await loser.edit("❌ **no results found.**")
|
||||||
else:
|
else:
|
||||||
songname = search[0]
|
songname = search[0]
|
||||||
|
title = search[0]
|
||||||
url = search[1]
|
url = search[1]
|
||||||
duration = search[2]
|
duration = search[2]
|
||||||
thumbnail = search[3]
|
thumbnail = search[3]
|
||||||
|
userid = m.from_user.id
|
||||||
|
gcname = m.chat.title
|
||||||
|
ctitle = await CHAT_TITLE(gcname)
|
||||||
|
image = await thumb(thumbnail, title, userid, ctitle)
|
||||||
veez, ytlink = await ytdl(url)
|
veez, ytlink = await ytdl(url)
|
||||||
if veez == 0:
|
if veez == 0:
|
||||||
await loser.edit(f"❌ yt-dl issues detected\n\n» `{ytlink}`")
|
await loser.edit(f"❌ yt-dl issues detected\n\n» `{ytlink}`")
|
||||||
@ -211,7 +218,7 @@ async def vplay(c: Client, m: Message):
|
|||||||
await loser.delete()
|
await loser.delete()
|
||||||
requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
|
requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
|
||||||
await m.reply_photo(
|
await m.reply_photo(
|
||||||
photo=thumbnail,
|
photo=image,
|
||||||
caption=f"💡 **Track added to queue »** `{pos}`\n\n🏷 **Name:** [{songname}]({url}) | `video`\n⏱ **Duration:** `{duration}`\n🎧 **Request by:** {requester}",
|
caption=f"💡 **Track added to queue »** `{pos}`\n\n🏷 **Name:** [{songname}]({url}) | `video`\n⏱ **Duration:** `{duration}`\n🎧 **Request by:** {requester}",
|
||||||
reply_markup=keyboard,
|
reply_markup=keyboard,
|
||||||
)
|
)
|
||||||
@ -231,7 +238,7 @@ async def vplay(c: Client, m: Message):
|
|||||||
await loser.delete()
|
await loser.delete()
|
||||||
requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
|
requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
|
||||||
await m.reply_photo(
|
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:** `Video`",
|
caption=f"🏷 **Name:** [{songname}]({url})\n⏱ **Duration:** `{duration}`\n💡 **Status:** `Playing`\n🎧 **Request by:** {requester}\n📹 **Stream type:** `Video`",
|
||||||
reply_markup=keyboard,
|
reply_markup=keyboard,
|
||||||
)
|
)
|
||||||
@ -254,9 +261,14 @@ async def vplay(c: Client, m: Message):
|
|||||||
await loser.edit("❌ **no results found.**")
|
await loser.edit("❌ **no results found.**")
|
||||||
else:
|
else:
|
||||||
songname = search[0]
|
songname = search[0]
|
||||||
|
title = search[0]
|
||||||
url = search[1]
|
url = search[1]
|
||||||
duration = search[2]
|
duration = search[2]
|
||||||
thumbnail = search[3]
|
thumbnail = search[3]
|
||||||
|
userid = m.from_user.id
|
||||||
|
gcname = m.chat.title
|
||||||
|
ctitle = await CHAT_TITLE(gcname)
|
||||||
|
image = await thumb(thumbnail, title, userid, ctitle)
|
||||||
veez, ytlink = await ytdl(url)
|
veez, ytlink = await ytdl(url)
|
||||||
if veez == 0:
|
if veez == 0:
|
||||||
await loser.edit(f"❌ yt-dl issues detected\n\n» `{ytlink}`")
|
await loser.edit(f"❌ yt-dl issues detected\n\n» `{ytlink}`")
|
||||||
@ -268,7 +280,7 @@ async def vplay(c: Client, m: Message):
|
|||||||
f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
|
f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
|
||||||
)
|
)
|
||||||
await m.reply_photo(
|
await m.reply_photo(
|
||||||
photo=thumbnail,
|
photo=image,
|
||||||
caption=f"💡 **Track added to queue »** `{pos}`\n\n🏷 **Name:** [{songname}]({url}) | `video`\n⏱ **Duration:** `{duration}`\n🎧 **Request by:** {requester}",
|
caption=f"💡 **Track added to queue »** `{pos}`\n\n🏷 **Name:** [{songname}]({url}) | `video`\n⏱ **Duration:** `{duration}`\n🎧 **Request by:** {requester}",
|
||||||
reply_markup=keyboard,
|
reply_markup=keyboard,
|
||||||
)
|
)
|
||||||
@ -288,7 +300,7 @@ async def vplay(c: Client, m: Message):
|
|||||||
await loser.delete()
|
await loser.delete()
|
||||||
requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
|
requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
|
||||||
await m.reply_photo(
|
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:** `Video`",
|
caption=f"🏷 **Name:** [{songname}]({url})\n⏱ **Duration:** `{duration}`\n💡 **Status:** `Playing`\n🎧 **Request by:** {requester}\n📹 **Stream type:** `Video`",
|
||||||
reply_markup=keyboard,
|
reply_markup=keyboard,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user