From f8977e39474b97d32a8d6fffda7725c8d7be063a Mon Sep 17 00:00:00 2001 From: Zaid Date: Thu, 16 Jun 2022 22:56:01 +0530 Subject: [PATCH 01/23] Update config.py --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index c992fc09..2e2253cd 100644 --- a/config.py +++ b/config.py @@ -54,7 +54,7 @@ START_PIC = getenv("START_PIC", "https://telegra.ph/file/a414e2cdfeaa7d4414b89.png") DURATION_LIMIT = int(getenv("DURATION_LIMIT", "60")) UPSTREAM_REPO = getenv("UPSTREAM_REPO", "https://github.com/ITZ-ZAID/Zaid-Vc-Player") -IMG_1 = getenv("IMG_1", "https://telegra.ph/file/c540aac0249486854787b.png") +PLAY_IMG = getenv("PLAY_IMG", "https://telegra.ph/file/10b1f781170b1e1867f68.png") IMG_2 = getenv("IMG_2", "https://telegra.ph/file/6f1cfec700087f6fcb391.png") IMG_3 = getenv("IMG_3", "https://telegra.ph/file/c3547532105a0cb67229d.png") IMG_4 = getenv("IMG_4", "https://telegra.ph/file/be5f551acb116292d15ec.png") From a73e37087a4a10b8315e30dd306898453996e57d Mon Sep 17 00:00:00 2001 From: Zaid Date: Thu, 16 Jun 2022 22:58:25 +0530 Subject: [PATCH 02/23] Update config.py --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index 2e2253cd..a7c5f06f 100644 --- a/config.py +++ b/config.py @@ -55,7 +55,7 @@ DURATION_LIMIT = int(getenv("DURATION_LIMIT", "60")) UPSTREAM_REPO = getenv("UPSTREAM_REPO", "https://github.com/ITZ-ZAID/Zaid-Vc-Player") PLAY_IMG = getenv("PLAY_IMG", "https://telegra.ph/file/10b1f781170b1e1867f68.png") -IMG_2 = getenv("IMG_2", "https://telegra.ph/file/6f1cfec700087f6fcb391.png") +QUE_IMG = getenv("QUE_IMG", "https://telegra.ph/file/b95c13eef1ebd14dbb458.png") IMG_3 = getenv("IMG_3", "https://telegra.ph/file/c3547532105a0cb67229d.png") IMG_4 = getenv("IMG_4", "https://telegra.ph/file/be5f551acb116292d15ec.png") IMG_5 = getenv("IMG_5", "https://telegra.ph/file/c3401a572375b569138c3.png") From 8e3f0d1af3b4e917695e306fe58863c14d37fb41 Mon Sep 17 00:00:00 2001 From: Zaid Date: Thu, 16 Jun 2022 23:02:13 +0530 Subject: [PATCH 03/23] Update play.py --- Zaid/Player/play.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Zaid/Player/play.py b/Zaid/Player/play.py index 4cb46f87..c4678f81 100644 --- a/Zaid/Player/play.py +++ b/Zaid/Player/play.py @@ -14,7 +14,7 @@ import requests from Zaid.fonts import CHAT_TITLE from PIL import Image, ImageDraw, ImageFont -from config import ASSISTANT_NAME, BOT_USERNAME, IMG_1, IMG_2, IMG_5, UPDATES_CHANNEL, GROUP_SUPPORT +from config import ASSISTANT_NAME, BOT_USERNAME, QUE_IMG, CMD_IMG, PLAY_IMG, UPDATES_CHANNEL, GROUP_SUPPORT from Zaid.filters import command, other_filters from Zaid.queues import QUEUE, add_to_queue from Zaid.main import call_py, Test as user, call_py2, call_py3, call_py4, call_py5 @@ -201,7 +201,7 @@ async def play(c: Client, m: Message): pos = add_to_queue(chat_id, songname, dl, link, "Audio", 0) await suhu.delete() await m.reply_photo( - photo=f"{IMG_1}", + photo=f"{QUE_IMG}", caption=f"💡 **Track added to queue »** `{pos}`\n\n🏷 **Name:** [{songname}]({link}) | `music`\n💭 **Chat:** `{chat_id}`\n🎧 **Request by:** {m.from_user.mention()}", reply_markup=keyboard, ) @@ -252,7 +252,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=f"{IMG_2}", + photo=f"{PLAY_IMG}", caption=f"🏷 **Name:** [{songname}]({link})\n💭 **Chat:** `{chat_id}`\n💡 **Status:** `Playing`\n🎧 **Request by:** {requester}\n📹 **Stream type:** `Music`", reply_markup=keyboard, ) @@ -263,7 +263,7 @@ async def play(c: Client, m: Message): else: if len(m.command) < 2: await m.reply_photo( - photo=f"{IMG_5}", + photo=f"{CMD_IMG}", caption="💬**Usage: /play Give a Title Song To Play Music or /vplay for Video Play**" , reply_markup=InlineKeyboardMarkup( @@ -291,7 +291,7 @@ async def play(c: Client, m: Message): userid = m.from_user.id gcname = m.chat.title ctitle = await CHAT_TITLE(gcname) - image = await generate_cover(thumbnail, title, userid, ctitle) + image = PLAY_IMG format = "bestaudio" abhi, ytlink = await ytdl(format, url) if abhi == 0: @@ -304,7 +304,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=image, + photo=f"{QUE_IMG}", caption=f"💡 **Track added to queue »** `{pos}`\n\n🏷 **Name:** [{songname[:22]}]({url}) | `music`\n**⏱ Duration:** `{duration}`\n🎧 **Request by:** {requester}", reply_markup=keyboard, ) @@ -358,7 +358,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=image, + photo=f"{PLAY_IMG}", caption=f"🏷 **Name:** [{songname[:22]}]({url})\n**⏱ Duration:** `{duration}`\n💡 **Status:** `Playing`\n🎧 **Request by:** {requester}", reply_markup=keyboard, ) From d2dd4e0d227818bdd95cb7eb21f5a059849a6009 Mon Sep 17 00:00:00 2001 From: Zaid Date: Thu, 16 Jun 2022 23:04:47 +0530 Subject: [PATCH 04/23] Update config.py --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index a7c5f06f..addbb5e5 100644 --- a/config.py +++ b/config.py @@ -56,7 +56,7 @@ UPSTREAM_REPO = getenv("UPSTREAM_REPO", "https://github.com/ITZ-ZAID/Zaid-Vc-Player") PLAY_IMG = getenv("PLAY_IMG", "https://telegra.ph/file/10b1f781170b1e1867f68.png") QUE_IMG = getenv("QUE_IMG", "https://telegra.ph/file/b95c13eef1ebd14dbb458.png") -IMG_3 = getenv("IMG_3", "https://telegra.ph/file/c3547532105a0cb67229d.png") +CMD_IMG = getenv("CMD_IMG", "https://telegra.ph/file/66518ed54301654f0b126.png") IMG_4 = getenv("IMG_4", "https://telegra.ph/file/be5f551acb116292d15ec.png") IMG_5 = getenv("IMG_5", "https://telegra.ph/file/c3401a572375b569138c3.png") IMG_6 = getenv("IMG_6", "https://telegra.ph/file/c3401a572375b569138c3.png") From 98207a2194f9c8962c45cfcc03f07e80c64676ca Mon Sep 17 00:00:00 2001 From: Zaid Date: Thu, 16 Jun 2022 23:08:26 +0530 Subject: [PATCH 05/23] Update config.py --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index addbb5e5..baf860f4 100644 --- a/config.py +++ b/config.py @@ -57,6 +57,6 @@ PLAY_IMG = getenv("PLAY_IMG", "https://telegra.ph/file/10b1f781170b1e1867f68.png") QUE_IMG = getenv("QUE_IMG", "https://telegra.ph/file/b95c13eef1ebd14dbb458.png") CMD_IMG = getenv("CMD_IMG", "https://telegra.ph/file/66518ed54301654f0b126.png") -IMG_4 = getenv("IMG_4", "https://telegra.ph/file/be5f551acb116292d15ec.png") +VIDEO_IMG = getenv("VIDEO_IMG", "https://telegra.ph/file/6213d2673486beca02967.png") IMG_5 = getenv("IMG_5", "https://telegra.ph/file/c3401a572375b569138c3.png") IMG_6 = getenv("IMG_6", "https://telegra.ph/file/c3401a572375b569138c3.png") From 6c9b788565b5320102d37f864b21746d299a20dc Mon Sep 17 00:00:00 2001 From: Zaid Date: Thu, 16 Jun 2022 23:11:11 +0530 Subject: [PATCH 06/23] Update video.py --- Zaid/Player/video.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zaid/Player/video.py b/Zaid/Player/video.py index ccfb76d0..7c3d74df 100644 --- a/Zaid/Player/video.py +++ b/Zaid/Player/video.py @@ -1,7 +1,7 @@ import re import asyncio -from config import ASSISTANT_NAME, BOT_USERNAME, IMG_1, IMG_2, IMG_6 +from config import ASSISTANT_NAME, BOT_USERNAME, QUE_IMG, VIDEO_IMG, CMD_IMG from Zaid.inline import stream_markup from Process.design.thumbnail import thumb from Process.design.chatname import CHAT_TITLE @@ -126,7 +126,7 @@ async def vplay(c: Client, m: Message): requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})" buttons = stream_markup(user_id) await m.reply_photo( - photo=thumbnail, + photo=f{""}, reply_markup=InlineKeyboardMarkup(buttons), caption=f"💡 **Track added to queue »** `{pos}`\n\n🗂 **Name:** [{songname}]({link}) | `video`\n💭 **Chat:** `{chat_id}`\n🧸 **Request by:** {requester}", ) From 51767f864dc550d20817da0a28923f6e47070614 Mon Sep 17 00:00:00 2001 From: Zaid Date: Thu, 16 Jun 2022 23:17:33 +0530 Subject: [PATCH 07/23] Update video.py --- Zaid/Player/video.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Zaid/Player/video.py b/Zaid/Player/video.py index 7c3d74df..ecbeb9f1 100644 --- a/Zaid/Player/video.py +++ b/Zaid/Player/video.py @@ -126,7 +126,7 @@ async def vplay(c: Client, m: Message): requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})" buttons = stream_markup(user_id) await m.reply_photo( - photo=f{""}, + photo=f"{QUE_IMG}", reply_markup=InlineKeyboardMarkup(buttons), caption=f"💡 **Track added to queue »** `{pos}`\n\n🗂 **Name:** [{songname}]({link}) | `video`\n💭 **Chat:** `{chat_id}`\n🧸 **Request by:** {requester}", ) @@ -194,14 +194,14 @@ async def vplay(c: Client, m: Message): requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})" buttons = stream_markup(user_id) await m.reply_photo( - photo=thumbnail, + photo=f"{VIDEO_IMG}", reply_markup=InlineKeyboardMarkup(buttons), caption=f"🗂 **Name:** [{songname}]({link}) | `video`\n💭 **Chat:** `{chat_id}`\n🧸 **Request by:** {requester}", ) else: if len(m.command) < 2: await m.reply_photo( - photo=f"{IMG_6}", + photo=f"{CMD_IMG}", caption="💬**Usage: /play Give a Title Song To Play Music or /vplay for Video Play**" , reply_markup=InlineKeyboardMarkup( @@ -229,7 +229,7 @@ async def vplay(c: Client, m: Message): userid = m.from_user.id gcname = m.chat.title ctitle = await CHAT_TITLE(gcname) - image = await thumb(thumbnail, title, userid, ctitle) + image = VIDEO_IMG veez, ytlink = await ytdl(url) if veez == 0: await loser.edit(f"❌ yt-dl issues detected\n\n» `{ytlink}`") @@ -242,7 +242,7 @@ async def vplay(c: Client, m: Message): requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})" buttons = stream_markup(user_id) await m.reply_photo( - photo=image, + photo=f"{QUE_IMG}", reply_markup=InlineKeyboardMarkup(buttons), caption=f"💡 **Track added to queue »** `{pos}`\n\n🗂 **Name:** [{songname}]({url}) | `video`\n⏱ **Duration:** `{duration}`\n🧸 **Request by:** {requester}", ) @@ -305,7 +305,7 @@ async def vplay(c: Client, m: Message): requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})" buttons = stream_markup(user_id) await m.reply_photo( - photo=image, + photo=f"{VIDEO_IMG}", reply_markup=InlineKeyboardMarkup(buttons), caption=f"🗂 **Name:** [{songname}]({url}) | `video`\n⏱ **Duration:** `{duration}`\n🧸 **Request by:** {requester}", ) @@ -316,7 +316,7 @@ async def vplay(c: Client, m: Message): else: if len(m.command) < 2: await m.reply_photo( - photo=f"{IMG_6}", + photo=f"{CMD_IMG}", caption="💬**Usage: /play Give a Title Song To Play Music or /vplay for Video Play**" , reply_markup=InlineKeyboardMarkup( @@ -355,7 +355,7 @@ async def vplay(c: Client, m: Message): requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})" buttons = stream_markup(user_id) await m.reply_photo( - photo=image, + photo=f"{QUE_IMG}", reply_markup=InlineKeyboardMarkup(buttons), caption=f"💡 **Track added to queue »** `{pos}`\n\n🗂 **Name:** [{songname}]({url}) | `video`\n⏱ **Duration:** `{duration}`\n🧸 **Request by:** {requester}", ) @@ -418,7 +418,7 @@ async def vplay(c: Client, m: Message): requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})" buttons = stream_markup(user_id) await m.reply_photo( - photo=image, + photo=f"{VIDEO_IMG}", reply_markup=InlineKeyboardMarkup(buttons), caption=f"🗂 **Name:** [{songname}]({url}) |`video`\n⏱ **Duration:** `{duration}`\n🧸 **Request by:** {requester}", ) @@ -502,7 +502,7 @@ async def vstream(c: Client, m: Message): requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})" buttons = stream_markup(user_id) await m.reply_photo( - photo=f"{IMG_1}", + photo=f"{QUE_IMG}", reply_markup=InlineKeyboardMarkup(buttons), caption=f"💡 **Track added to queue »** `{pos}`\n\n💭 **Chat:** `{chat_id}`\n🧸 **Request by:** {requester}", ) @@ -571,7 +571,7 @@ async def vstream(c: Client, m: Message): requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})" buttons = stream_markup(user_id) await m.reply_photo( - photo=f"{IMG_2}", + photo=f"{VIDEO_IMG}", reply_markup=InlineKeyboardMarkup(buttons), caption=f"💡 **[__Live Streaming Started__]({link}) **\n\n💭 **Chat:** `{chat_id}`\n🧸 **Request by:** {requester}", ) From 6a06fa9061a81db3a6769e5b5998cbcfc305c1a8 Mon Sep 17 00:00:00 2001 From: Zaid Date: Thu, 16 Jun 2022 23:21:17 +0530 Subject: [PATCH 08/23] Update config.py --- config.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config.py b/config.py index baf860f4..6c665b29 100644 --- a/config.py +++ b/config.py @@ -58,5 +58,4 @@ QUE_IMG = getenv("QUE_IMG", "https://telegra.ph/file/b95c13eef1ebd14dbb458.png") CMD_IMG = getenv("CMD_IMG", "https://telegra.ph/file/66518ed54301654f0b126.png") VIDEO_IMG = getenv("VIDEO_IMG", "https://telegra.ph/file/6213d2673486beca02967.png") -IMG_5 = getenv("IMG_5", "https://telegra.ph/file/c3401a572375b569138c3.png") -IMG_6 = getenv("IMG_6", "https://telegra.ph/file/c3401a572375b569138c3.png") +SKIP_IMG = getenv("SKIP_IMG", "https://telegra.ph/file/f02efde766160d3ff52d6.png") From f1367aa94998eba991d39d95a01a0fce11570c22 Mon Sep 17 00:00:00 2001 From: Zaid Date: Thu, 16 Jun 2022 23:22:31 +0530 Subject: [PATCH 09/23] Update admins.py --- Zaid/Player/admins.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zaid/Player/admins.py b/Zaid/Player/admins.py index af6ebf43..528ff9dd 100644 --- a/Zaid/Player/admins.py +++ b/Zaid/Player/admins.py @@ -6,7 +6,7 @@ from Zaid.filters import command, other_filters from Zaid.queues import QUEUE, clear_queue from Zaid.utils import skip_current_song, skip_item -from config import BOT_USERNAME, GROUP_SUPPORT, IMG_3, UPDATES_CHANNEL +from config import BOT_USERNAME, GROUP_SUPPORT, SKIP_IMG, UPDATES_CHANNEL from pyrogram.types import ( CallbackQuery, InlineKeyboardButton, @@ -70,7 +70,7 @@ async def skip(client, m: Message): await m.reply("🗑️ **Clearing the Queues**\n\n**• userbot leaving voice chat**") else: await m.reply_photo( - photo=f"{IMG_3}", + photo=f"{SKIP_IMG}", caption=f"⏭ **Skipped to the next track.**\n\n🏷 **Name:** [{op[0]}]({op[1]})\n💭 **Chat:** `{chat_id}`\n💡 **Status:** `Playing`\n🎧 **Request by:** {m.from_user.mention()}", reply_markup=keyboard, ) From 264072d92a07a44d734b09d2d8445bd0b7bcd3f5 Mon Sep 17 00:00:00 2001 From: Zaid Date: Thu, 16 Jun 2022 23:25:27 +0530 Subject: [PATCH 10/23] Update utils.py --- Zaid/utils.py | 77 +++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 62 insertions(+), 15 deletions(-) diff --git a/Zaid/utils.py b/Zaid/utils.py index 304f30f2..47d267b1 100644 --- a/Zaid/utils.py +++ b/Zaid/utils.py @@ -241,33 +241,80 @@ async def left_handler(_, chat_id: int): @call_py.on_stream_end() async def stream_end_handler(_, u: Update): - chat_id = u.chat_id - print(chat_id) - await skip_current_song(chat_id) + if isinstance(u, StreamAudioEnded): + chat_id = u.chat_id + print(chat_id) + op = await skip_current_song(chat_id) + if op==1: + await bot.send_message(chat_id, "✅ **userbot has disconnected from video chat.**") + elif op==2: + await bot.send_message(chat_id, "❌ **an error occurred**\n\n» **Clearing** __Queues__ **and leaving video chat.**") + else: + await bot.send_message(chat_id, f"💡 **Streaming next track**\n\n🏷 **Name:** [{op[0]}]({op[1]}) | `{op[2]}`\n💭 **Chat:** `{chat_id}`", disable_web_page_preview=True, reply_markup=keyboard) + else: + pass + @call_py2.on_stream_end() async def stream_end_handler(_, u: Update): - chat_id = u.chat_id - print(chat_id) - await skip_current_song(chat_id) + if isinstance(u, StreamAudioEnded): + chat_id = u.chat_id + print(chat_id) + op = await skip_current_song(chat_id) + if op==1: + await bot.send_message(chat_id, "✅ **userbot has disconnected from video chat.**") + elif op==2: + await bot.send_message(chat_id, "❌ **an error occurred**\n\n» **Clearing** __Queues__ **and leaving video chat.**") + else: + await bot.send_message(chat_id, f"💡 **Streaming next track**\n\n🏷 **Name:** [{op[0]}]({op[1]}) | `{op[2]}`\n💭 **Chat:** `{chat_id}`", disable_web_page_preview=True, reply_markup=keyboard) + else: + pass + @call_py3.on_stream_end() async def stream_end_handler(_, u: Update): - chat_id = u.chat_id - print(chat_id) - await skip_current_song(chat_id) + if isinstance(u, StreamAudioEnded): + chat_id = u.chat_id + print(chat_id) + op = await skip_current_song(chat_id) + if op==1: + await bot.send_message(chat_id, "✅ **userbot has disconnected from video chat.**") + elif op==2: + await bot.send_message(chat_id, "❌ **an error occurred**\n\n» **Clearing** __Queues__ **and leaving video chat.**") + else: + await bot.send_message(chat_id, f"💡 **Streaming next track**\n\n🏷 **Name:** [{op[0]}]({op[1]}) | `{op[2]}`\n💭 **Chat:** `{chat_id}`", disable_web_page_preview=True, reply_markup=keyboard) + else: + pass @call_py4.on_stream_end() async def stream_end_handler(_, u: Update): - chat_id = u.chat_id - print(chat_id) - await skip_current_song(chat_id) + if isinstance(u, StreamAudioEnded): + chat_id = u.chat_id + print(chat_id) + op = await skip_current_song(chat_id) + if op==1: + await bot.send_message(chat_id, "✅ **userbot has disconnected from video chat.**") + elif op==2: + await bot.send_message(chat_id, "❌ **an error occurred**\n\n» **Clearing** __Queues__ **and leaving video chat.**") + else: + await bot.send_message(chat_id, f"💡 **Streaming next track**\n\n🏷 **Name:** [{op[0]}]({op[1]}) | `{op[2]}`\n💭 **Chat:** `{chat_id}`", disable_web_page_preview=True, reply_markup=keyboard) + else: + pass @call_py5.on_stream_end() async def stream_end_handler(_, u: Update): - chat_id = u.chat_id - print(chat_id) - await skip_current_song(chat_id) + if isinstance(u, StreamAudioEnded): + chat_id = u.chat_id + print(chat_id) + op = await skip_current_song(chat_id) + if op==1: + await bot.send_message(chat_id, "✅ **userbot has disconnected from video chat.**") + elif op==2: + await bot.send_message(chat_id, "❌ **an error occurred**\n\n» **Clearing** __Queues__ **and leaving video chat.**") + else: + await bot.send_message(chat_id, f"💡 **Streaming next track**\n\n🏷 **Name:** [{op[0]}]({op[1]}) | `{op[2]}`\n💭 **Chat:** `{chat_id}`", disable_web_page_preview=True, reply_markup=keyboard) + else: + pass async def bash(cmd): From eb035108e71e0c8b75e68c48a5293724dd93dfc8 Mon Sep 17 00:00:00 2001 From: Zaid Date: Thu, 16 Jun 2022 23:38:31 +0530 Subject: [PATCH 11/23] Image added --- Zaid/utils.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Zaid/utils.py b/Zaid/utils.py index 47d267b1..6fe8ca8b 100644 --- a/Zaid/utils.py +++ b/Zaid/utils.py @@ -1,6 +1,7 @@ import os import asyncio from Zaid.main import bot, call_py, call_py2, call_py3, call_py4, call_py5 +from config import NEXT_IMG from pytgcalls.types import Update from pytgcalls.types.input_stream import AudioPiped, AudioVideoPiped from Zaid.queues import QUEUE, clear_queue, get_queue, pop_an_item @@ -250,7 +251,7 @@ async def stream_end_handler(_, u: Update): elif op==2: await bot.send_message(chat_id, "❌ **an error occurred**\n\n» **Clearing** __Queues__ **and leaving video chat.**") else: - await bot.send_message(chat_id, f"💡 **Streaming next track**\n\n🏷 **Name:** [{op[0]}]({op[1]}) | `{op[2]}`\n💭 **Chat:** `{chat_id}`", disable_web_page_preview=True, reply_markup=keyboard) + await bot.send_photo(chat_id, f"{NEXT_IMG}", caption=f"💡 **Streaming next track**\n\n🏷 **Name:** [{op[0]}]({op[1]}) | `{op[2]}`\n💭 **Chat:** `{chat_id}`", disable_web_page_preview=True, reply_markup=keyboard) else: pass @@ -266,7 +267,7 @@ async def stream_end_handler(_, u: Update): elif op==2: await bot.send_message(chat_id, "❌ **an error occurred**\n\n» **Clearing** __Queues__ **and leaving video chat.**") else: - await bot.send_message(chat_id, f"💡 **Streaming next track**\n\n🏷 **Name:** [{op[0]}]({op[1]}) | `{op[2]}`\n💭 **Chat:** `{chat_id}`", disable_web_page_preview=True, reply_markup=keyboard) + await bot.send_photo(chat_id, f"{NEXT_IMG}", caption=f"💡 **Streaming next track**\n\n🏷 **Name:** [{op[0]}]({op[1]}) | `{op[2]}`\n💭 **Chat:** `{chat_id}`", disable_web_page_preview=True, reply_markup=keyboard) else: pass @@ -282,7 +283,7 @@ async def stream_end_handler(_, u: Update): elif op==2: await bot.send_message(chat_id, "❌ **an error occurred**\n\n» **Clearing** __Queues__ **and leaving video chat.**") else: - await bot.send_message(chat_id, f"💡 **Streaming next track**\n\n🏷 **Name:** [{op[0]}]({op[1]}) | `{op[2]}`\n💭 **Chat:** `{chat_id}`", disable_web_page_preview=True, reply_markup=keyboard) + await bot.send_photo(chat_id, f"{NEXT_IMG}", caption=f"💡 **Streaming next track**\n\n🏷 **Name:** [{op[0]}]({op[1]}) | `{op[2]}`\n💭 **Chat:** `{chat_id}`", disable_web_page_preview=True, reply_markup=keyboard) else: pass @@ -297,7 +298,7 @@ async def stream_end_handler(_, u: Update): elif op==2: await bot.send_message(chat_id, "❌ **an error occurred**\n\n» **Clearing** __Queues__ **and leaving video chat.**") else: - await bot.send_message(chat_id, f"💡 **Streaming next track**\n\n🏷 **Name:** [{op[0]}]({op[1]}) | `{op[2]}`\n💭 **Chat:** `{chat_id}`", disable_web_page_preview=True, reply_markup=keyboard) + await bot.send_photo(chat_id, f"{NEXT_IMG}", caption=f"💡 **Streaming next track**\n\n🏷 **Name:** [{op[0]}]({op[1]}) | `{op[2]}`\n💭 **Chat:** `{chat_id}`", disable_web_page_preview=True, reply_markup=keyboard) else: pass @@ -312,7 +313,7 @@ async def stream_end_handler(_, u: Update): elif op==2: await bot.send_message(chat_id, "❌ **an error occurred**\n\n» **Clearing** __Queues__ **and leaving video chat.**") else: - await bot.send_message(chat_id, f"💡 **Streaming next track**\n\n🏷 **Name:** [{op[0]}]({op[1]}) | `{op[2]}`\n💭 **Chat:** `{chat_id}`", disable_web_page_preview=True, reply_markup=keyboard) + await bot.send_photo(chat_id, f"{NEXT_IMG}", caption=f"💡 **Streaming next track**\n\n🏷 **Name:** [{op[0]}]({op[1]}) | `{op[2]}`\n💭 **Chat:** `{chat_id}`", disable_web_page_preview=True, reply_markup=keyboard) else: pass From 290b29e4828525108bbd2acd4d2734cb2b63dca6 Mon Sep 17 00:00:00 2001 From: Zaid Date: Thu, 16 Jun 2022 23:40:30 +0530 Subject: [PATCH 12/23] Update config.py --- config.py | 1 + 1 file changed, 1 insertion(+) diff --git a/config.py b/config.py index 6c665b29..64b4ade3 100644 --- a/config.py +++ b/config.py @@ -59,3 +59,4 @@ CMD_IMG = getenv("CMD_IMG", "https://telegra.ph/file/66518ed54301654f0b126.png") VIDEO_IMG = getenv("VIDEO_IMG", "https://telegra.ph/file/6213d2673486beca02967.png") SKIP_IMG = getenv("SKIP_IMG", "https://telegra.ph/file/f02efde766160d3ff52d6.png") +NEXT_IMG = getenv("NEXT_IMG", "https://telegra.ph/file/f02efde766160d3ff52d6.png") From 4456e87d0880fae7cda768b12719c8c7fa3454a5 Mon Sep 17 00:00:00 2001 From: Zaid Date: Thu, 16 Jun 2022 23:42:38 +0530 Subject: [PATCH 13/23] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f8219fc7..b36e4f6f 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ [ꜰᴏʀᴋ ᴅᴇᴘʟᴏʏ ɪꜱ ʜɪɢʜʟʏ ʀᴇᴄᴏᴍᴍᴇɴᴅᴇᴅ](https://telegra.ph/file/5bcf79f948ca06030640c.mp4) -

+

> Click on buttons below to expand and detailed explanation process. ! From 54f1b6b1ac500cb1c0b1e0af352ab1047256fa4e Mon Sep 17 00:00:00 2001 From: Zaid Date: Fri, 17 Jun 2022 00:02:56 +0530 Subject: [PATCH 14/23] Update main.py --- Zaid/main.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/Zaid/main.py b/Zaid/main.py index 5f74f496..c25b0a53 100644 --- a/Zaid/main.py +++ b/Zaid/main.py @@ -25,34 +25,42 @@ if not SESSION_NAME: ASS_CLI_1 = None + call_py = None else: ASS_CLI_1 = Client(SESSION_NAME, api_id=API_ID, api_hash=API_HASH) + call_py = PyTgCalls(Test) if not SESSION2: user = None + call_py2 = None + else: user = Client(SESSION2, api_id=API_ID, api_hash=API_HASH) + call_py2 = PyTgCalls(user) if not SESSION3: user3 = None + call_py3 = None else: user3 = Client(SESSION3, api_id=API_ID, api_hash=API_HASH) -if not SESSION2: + call_py3 = PyTgCalls(user3) + +if not SESSION4: user4 = None + call_py4 = None else: user4 = Client(SESSION4, api_id=API_ID, api_hash=API_HASH) -if not SESSION2: + call_py4 = PyTgCalls(user4) + +if not SESSION5: user5 = None + call_py = None else: user5 = Client(SESSION5, api_id=API_ID, api_hash=API_HASH) + call_py = PyTgCalls(user5) Test = ASS_CLI_1 ASS_CLI_2 = user -call_py = PyTgCalls(Test) -call_py2 = PyTgCalls(user) -call_py3 = PyTgCalls(user3) -call_py4 = PyTgCalls(user4) -call_py5 = PyTgCalls(user5) ASSIDS = [] ASSID1 = 0 From ce6ef5955ea1d63d609d22c385a7740673fcc5a0 Mon Sep 17 00:00:00 2001 From: Zaid Date: Fri, 17 Jun 2022 00:08:28 +0530 Subject: [PATCH 15/23] Update main.py --- Zaid/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zaid/main.py b/Zaid/main.py index c25b0a53..7306c26b 100644 --- a/Zaid/main.py +++ b/Zaid/main.py @@ -28,7 +28,7 @@ call_py = None else: ASS_CLI_1 = Client(SESSION_NAME, api_id=API_ID, api_hash=API_HASH) - call_py = PyTgCalls(Test) + call_py = PyTgCalls(ASS_CLI_1) if not SESSION2: user = None From 62dc12d1f8a853ea0a9a870c4cec8c746a3b1dac Mon Sep 17 00:00:00 2001 From: Zaid Date: Fri, 17 Jun 2022 00:13:37 +0530 Subject: [PATCH 16/23] Update main.py --- Zaid/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zaid/main.py b/Zaid/main.py index 7306c26b..af7db491 100644 --- a/Zaid/main.py +++ b/Zaid/main.py @@ -54,10 +54,10 @@ if not SESSION5: user5 = None - call_py = None + call_py5 = None else: user5 = Client(SESSION5, api_id=API_ID, api_hash=API_HASH) - call_py = PyTgCalls(user5) + call_py5 = PyTgCalls(user5) Test = ASS_CLI_1 ASS_CLI_2 = user From acf8f336f659f5de1ceef9297e560fcf37e5036e Mon Sep 17 00:00:00 2001 From: Zaid Date: Fri, 17 Jun 2022 00:22:12 +0530 Subject: [PATCH 17/23] Update main.py --- Zaid/main.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Zaid/main.py b/Zaid/main.py index af7db491..553ab1e5 100644 --- a/Zaid/main.py +++ b/Zaid/main.py @@ -1,3 +1,4 @@ + import os import sys import random @@ -25,42 +26,42 @@ if not SESSION_NAME: ASS_CLI_1 = None - call_py = None else: ASS_CLI_1 = Client(SESSION_NAME, api_id=API_ID, api_hash=API_HASH) - call_py = PyTgCalls(ASS_CLI_1) + if not SESSION2: user = None - call_py2 = None - else: user = Client(SESSION2, api_id=API_ID, api_hash=API_HASH) - call_py2 = PyTgCalls(user) + if not SESSION3: user3 = None - call_py3 = None else: user3 = Client(SESSION3, api_id=API_ID, api_hash=API_HASH) - call_py3 = PyTgCalls(user3) if not SESSION4: user4 = None - call_py4 = None else: user4 = Client(SESSION4, api_id=API_ID, api_hash=API_HASH) - call_py4 = PyTgCalls(user4) + if not SESSION5: user5 = None - call_py5 = None else: user5 = Client(SESSION5, api_id=API_ID, api_hash=API_HASH) - call_py5 = PyTgCalls(user5) + + +call_py5 = PyTgCalls(user5) Test = ASS_CLI_1 ASS_CLI_2 = user +call_py = PyTgCalls(ASS_CLI_1) +call_py2 = PyTgCalls(user) +call_py3 = PyTgCalls(user3) +call_py4 = PyTgCalls(user4) +call_py5 = PyTgCalls(user5) ASSIDS = [] ASSID1 = 0 From b73fe66b9338bdca017b7a0c429f7ff9cc8a7720 Mon Sep 17 00:00:00 2001 From: Zaid Date: Fri, 17 Jun 2022 00:30:47 +0530 Subject: [PATCH 18/23] Update config.py --- config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config.py b/config.py index 64b4ade3..a1708547 100644 --- a/config.py +++ b/config.py @@ -10,7 +10,10 @@ load_dotenv() admins = {} -SESSION_NAME = getenv("SESSION_NAME", "") +if str(getenv("SESSION_NAME")).strip() == "": + SESSION_NAME = str(None) +else: + SESSION_NAME = str(getenv("SESSION_NAME", "")) if str(getenv("STRING_SESSION2")).strip() == "": SESSION2 = str(None) From 919541949f25415280c600cbe7149a6722c9a6b4 Mon Sep 17 00:00:00 2001 From: Zaid Date: Fri, 17 Jun 2022 00:31:26 +0530 Subject: [PATCH 19/23] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7a73769b..5cb48056 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,4 +10,4 @@ RUN mkdir /app/ WORKDIR /app/ COPY . /app/ RUN pip3 install -U -r requirements.txt -CMD python3 main.py +CMD bash start From d1987e93a8b7f2f40f2fe5315404262ae07a4562 Mon Sep 17 00:00:00 2001 From: Zaid Date: Fri, 17 Jun 2022 00:31:47 +0530 Subject: [PATCH 20/23] Update start --- start | 1 - 1 file changed, 1 deletion(-) diff --git a/start b/start index 19df579d..0af6d448 100644 --- a/start +++ b/start @@ -1,4 +1,3 @@ git clone $REPO_URL Xyz cd Xyz -pip3 install -U -r requirements.txt python3 main.py From eb5a02cab3ab8bb6d58f7f5846ac9aa3931fc86d Mon Sep 17 00:00:00 2001 From: Zaid Date: Fri, 17 Jun 2022 00:37:07 +0530 Subject: [PATCH 21/23] Update config.py --- config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.py b/config.py index a1708547..57c83ee7 100644 --- a/config.py +++ b/config.py @@ -13,12 +13,12 @@ if str(getenv("SESSION_NAME")).strip() == "": SESSION_NAME = str(None) else: - SESSION_NAME = str(getenv("SESSION_NAME", "")) + SESSION_NAME = str(getenv("SESSION_NAME")) if str(getenv("STRING_SESSION2")).strip() == "": SESSION2 = str(None) else: - SESSION2 = str(getenv("STRING_SESSION2", "")) + SESSION2 = str(getenv("STRING_SESSION2")) if str(getenv("STRING_SESSION3")).strip() == "": SESSION3 = str(None) From 3c919348c891478381d346ab9aeafaf022842e42 Mon Sep 17 00:00:00 2001 From: Zaid Date: Fri, 17 Jun 2022 00:44:14 +0530 Subject: [PATCH 22/23] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5cb48056..7a73769b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,4 +10,4 @@ RUN mkdir /app/ WORKDIR /app/ COPY . /app/ RUN pip3 install -U -r requirements.txt -CMD bash start +CMD python3 main.py From 71c969c46ecf620109bc9a98aee0fa864f91f46c Mon Sep 17 00:00:00 2001 From: Zaid Date: Fri, 17 Jun 2022 00:45:29 +0530 Subject: [PATCH 23/23] Update video.py --- Zaid/Player/video.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zaid/Player/video.py b/Zaid/Player/video.py index ecbeb9f1..49a49bdb 100644 --- a/Zaid/Player/video.py +++ b/Zaid/Player/video.py @@ -573,7 +573,7 @@ async def vstream(c: Client, m: Message): await m.reply_photo( photo=f"{VIDEO_IMG}", reply_markup=InlineKeyboardMarkup(buttons), - caption=f"💡 **[__Live Streaming Started__]({link}) **\n\n💭 **Chat:** `{chat_id}`\n🧸 **Request by:** {requester}", + caption=f"💡 **[__Live Streaming Started__]({link}) **\n\n💭 **Chatinfo:** `{chat_id}`\n🧸 **Request by:** {requester}", ) except Exception as ep: await loser.delete()