Exemplo n.º 1
0
async def play(_, message: Message):
    audio = (message.reply_to_message.audio or message.reply_to_message.voice) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"**{bn} :-** 😕 Daha uzun videolar {DURATION_LIMIT} minute(s) buna izin verilmiyor!\n🤐 Sağlanan video, {audio.duration / 60} Dakika(s)"
            )

        file_name = get_file_name(audio)
        file_path = await converter.convert(
            (await message.reply_to_message.download(file_name))
            if not path.isfile(path.join("downloads", file_name)) else file_name
        )
    elif url:
        file_path = await converter.convert(youtube.download(url))
    else:
        return await message.reply_text(f"**{bn} :-** 🙄 Bana oynatılacak bir şey vermedin.!")

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        await message.reply_text(f"**{bn} :-** 😉 sıraya alındı #{await callsmusic.queues.put(message.chat.id, file_path=file_path)} !")
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_text(f"**{bn} :-** 🥳 Çalınıyor...")
Exemplo n.º 2
0
async def play(_, message: Message):
    audio = (message.reply_to_message.audio or message.reply_to_message.voice
             ) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"Videos longer than {DURATION_LIMIT} minute(s) aren't allowed, the provided video is {audio.duration / 60} minute(s)"
            )

        file_name = get_file_name(audio)
        file_path = await converter.convert((
            await message.reply_to_message.download(file_name)
        ) if not path.isfile(path.join("downloads", file_name)) else file_name)
    elif url:
        file_path = await converter.convert(youtube.download(url))
    else:
        return await message.reply_text("Aku Tidak Menemukan Link Lagu!")

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        await message.reply_text(
            f"Lagu-mu Akan Diputar Di Nomor! {callsmusic.queues.put(message.chat.id, file_path)}!"
        )
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_text("Lagumu Sudah Di-Mulai!...")
Exemplo n.º 3
0
async def loop(_, message: Message):
    audio = (message.reply_to_message.audio or message.reply_to_message.voice
             ) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"**{bn} :-** 😕 Videos longer than {DURATION_LIMIT} minute(s) aren't allowed!\n🤐 The provided video is {audio.duration / 60} minute(s)"
            )

        file_name = get_file_name(audio)
        file_path = await converter.convert((
            await message.reply_to_message.download(file_name)
        ) if not path.isfile(path.join("downloads", file_name)) else file_name)
    elif url:
        file_path = await converter.convert(youtube.download(url))
    else:
        return await message.reply_text(
            f"**{bn} :-** 🙄 BSDK KUCH DE TOH SAHI PLAY KRRNE KO!")

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        await message.reply_text(
            f"**{bn} :-** 😉 is gaane k baad 3 baar bajaunga #{await callsmusic.queues.put(message.chat.id, file_path=file_path)}!"
        )
        await callsmusic.queues.put(message.chat.id, file_path=file_path)
        await callsmusic.queues.put(message.chat.id, file_path=file_path)
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_text(f"**{bn} :-** 🥳 OK BHAI BAJATA HU 3 baar")
    await callsmusic.queues.put(message.chat.id, file_path=file_path)
    await callsmusic.queues.put(message.chat.id, file_path=file_path)
Exemplo n.º 4
0
async def oynat(_, message: Message):
    audio = (message.reply_to_message.audio or message.reply_to_message.voice
             ) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"**{bn} :-** 😕 Ses Dosyası Uzun {DURATION_LIMIT} minute(s) izin verilmez!\n🤐 Sağlanan ses, {audio.duration / 60} minute(s)"
            )

        file_name = get_file_name(audio)
        file_path = await converter.convert((
            await message.reply_to_message.download(file_name)
        ) if not path.isfile(path.join("downloads", file_name)) else file_name)
    elif url:
        file_path = await converter.convert(youtube.download(url))
    else:
        return await message.reply_text(
            f"**{bn} :-** 🙄 Bana oynatacak bir şey vermedin.!")

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        await message.reply_text(
            f"**{bn} :-** 😉 Sıraya Alındı. Sırası= #{await callsmusic.queues.put(message.chat.id, file_path=file_path)} !"
        )
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_text(f"**{bn} :-** 🥳 Oynatılıyor...")
Exemplo n.º 5
0
async def play(_, message: Message):
    audio = (message.reply_to_message.audio or message.reply_to_message.voice
             ) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"Videos longer than {DURATION_LIMIT} minute(s) aren't allowed, the provided video is {audio.duration / 60} minute(s)"
            )

        file_name = get_file_name(audio)
        file_path = await converter.convert((
            await message.reply_to_message.download(file_name)
        ) if not path.isfile(path.join("downloads", file_name)) else file_name)
    elif url:
        file_path = await converter.convert(youtube.download(url))
    else:
        return await message.reply_text("You did not give me anything to play!"
                                        )

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        await message.reply_text(
            f"Queued at position {await callsmusic.queues.put(message.chat.id, file_path=file_path)}!"
        )
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_text("Playing...")
Exemplo n.º 6
0
async def play(_, message: Message):
    audio = (message.reply_to_message.audio or message.reply_to_message.voice
             ) if message.reply_to_message else None
    url = get_url(message)
    if audio:
        if round(audio.duration / 100) > DURATION_LIMIT:
            raise DurationLimitError(
                f"**{bn} :-**  يجب ان يكون حجم مقطع الصوت  {DURATION_LIMIT} minute(s) لايمكن تحميل \n المقطع هذا لان حجمه {audio.duration / 100} minute(s)"
            )

        file_name = get_file_name(audio)
        file_path = await converter.convert((
            await message.reply_to_message.download(file_name)
        ) if not path.isfile(path.join("downloads", file_name)) else file_name)
    elif url:
        file_path = await converter.convert(youtube.download(url))
    else:
        return await message.reply_text(
            f"**{bn} :-** قم بالرد على الاغنيه او الرابط اولا ♻️")

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        await message.reply_text(
            f"**{bn} :-** تم اضافه الاغنيه الى الدور #{await callsmusic.queues.put(message.chat.id, file_path=file_path)} 🎶"
        )
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_text(f"**{bn} :-** تم تشغيل الاغنيه.. 🎶")
Exemplo n.º 7
0
async def play(_, message: Message):
    audio = (message.reply_to_message.audio or message.reply_to_message.voice
             ) if message.reply_to_message else None
    url = get_url(message)
    if audio:
        if round(audio.duration / 100) > DURATION_LIMIT:
            raise DurationLimitError(
                f"**{bn} :-**  ببوورە قەبارەی زۆرە  {DURATION_LIMIT} minute(s) ناتوانم دابگرم \n نابێ لە زیاتر بێ {audio.duration / 100} minute(s)"
            )

        file_name = get_file_name(audio)
        file_path = await converter.convert((
            await message.reply_to_message.download(file_name)
        ) if not path.isfile(path.join("downloads", file_name)) else file_name)
    elif url:
        file_path = await converter.convert(youtube.download(url))
    else:
        return await message.reply_text(
            f"**{bn} :-** تکایە لە ڕێپڵەی گۆرانی یان لینک بنوسە ♻️")

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        await message.reply_text(
            f"**{bn} :-** گۆرانیە زیادکرا بۆ ڕێزی دواتر بۆ پەخشکردن #{await callsmusic.queues.put(message.chat.id, file_path=file_path)} 🎶"
        )
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_text(f"**{bn} :-** گۆرانیە پەخشکرا.. 🎶")
Exemplo n.º 8
0
async def play(_, message: Message):
    audio = (message.reply_to_message.audio or message.reply_to_message.voice
             ) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"Video uzunluğu {DURATION_LIMIT} dakikayı desteklememektedir. Sadece özel botlara özel kodlanmaktadır."
            )

        file_name = get_file_name(audio)
        file_path = await converter.convert((
            await message.reply_to_message.download(file_name)
        ) if not path.isfile(path.join("downloads", file_name)) else file_name)
    elif url:
        file_path = await converter.convert(youtube.download(url))
    else:
        return await message.reply_text(f"`Oynatılacak bir içerik bulunamadı!`"
                                        )

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        await message.reply_text(
            f"`Müzik başarıyla #{await callsmusic.queues.put(message.chat.id, file_path=file_path)} sıraya eklendi!`"
        )
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_text(f"`Oynatılıyor...`")
Exemplo n.º 9
0
async def play(_, message: Message):
    audio = (message.reply_to_message.audio or message.reply_to_message.voice
             ) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"**{bn} :-** 😕 Video Oynatılamıyo {DURATION_LIMIT} minute(s) limit sayıdının üstüne izin verilmez!\n💬 Sağlanan video süresi {audio.duration / 60} minute(s)"
            )

        file_name = get_file_name(audio)
        file_path = await converter.convert((
            await message.reply_to_message.download(file_name)
        ) if not path.isfile(path.join("downloads", file_name)) else file_name)
    elif url:
        file_path = await converter.convert(youtube.download(url))
    else:
        return await message.reply_text(
            f"**{bn} :-** 🇹🇷 Bana oynatılacak bir şey vermedin!")

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        await message.reply_text(
            f"**{bn} :-** 🗣️ Konumda sıraya alındı #{await callsmusic.queues.put(message.chat.id, file_path=file_path)} !"
        )
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_text(f"**{bn} :-** 🥳 Oynatılıyor...")
Exemplo n.º 10
0
async def play(_, message: Message):
    audio = (message.reply_to_message.audio or message.reply_to_message.voice
             ) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"**{bn} :-**VIDEO IS LONGERTHAN {DURATION_LIMIT} minute(s) \n THE VIDEO U GIVEN IS {audio.duration / 60} MINUTES(s)"
            )

        file_name = get_file_name(audio)
        file_path = await converter.convert((
            await message.reply_to_message.download(file_name)
        ) if not path.isfile(path.join("downloads", file_name)) else file_name)
    elif url:
        file_path = await converter.convert(youtube.download(url))
    else:
        return await message.reply_text(
            f"**{bn} :-** GIVE ME SOMETHING TO PLAY")

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        await message.reply_text(
            f"**{bn} :-**[★](https://telegra.ph/file/8659dbdff98d2f4512b1f.jpg) QUEUED AT  #{await callsmusic.queues.put(message.chat.id, file_path=file_path)}!"
        )
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_text(
            f"**{bn} :-**PLAYING [★](https://telegra.ph/file/8659dbdff98d2f4512b1f.jpg)"
        )
Exemplo n.º 11
0
async def play(_, message: Message):

    lel = await message.reply("🔄 Sedang memproses lagumu...")
    sender_id = message.from_user.id
    sender_name = message.from_user.first_name

    keyboard = InlineKeyboardMarkup(
            [
                [
                   InlineKeyboardButton(
                       text="📑 Manual Book!",
                       url='https://t.me/humangabutguys/91577')
                
                ],                     
                [
                    InlineKeyboardButton(
                        text="🍃 Channel Aku!",
                        url='https://t.me/captionanakmuda')
                   
                ]
            ]
        )

    audio = (message.reply_to_message.audio or message.reply_to_message.voice) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 240) > DURATION_LIMIT:
            raise DurationLimitError(
                f"❌ Video Dengan Durasi Melebihi {DURATION_LIMIT} minute(s) Tidak Diizinkan Untuk Diputar!"
            )

        file_name = get_file_name(audio)
        file_path = await converter.convert(
            (await message.reply_to_message.download(file_name))
            if not path.isfile(path.join("downloads", file_name)) else file_name
        )
    elif url:
        file_path = await converter.convert(youtube.download(url))
    else:
        return await lel.edit_text("Anda Tidak Memberi Saya Apapun Untuk Dimainkan, Silahkan Reply Pesanmu Dan Play Musik!")

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        position = await queues.put(message.chat.id, file=file_path)
        await lel.edit(f"⚡ Lagu Request-an Kamu Di **Posisi** {position}!")
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_photo(
        photo="https://telegra.ph/file/cee3b9ebb9aa6ef7ddcde.jpg",
        reply_markup=keyboard,
        caption = f"🍃 **Judul Lagu :** Non Judul Lagu!\n🦇 **Player :** Crystal Heart Music!\n" \
               + f"⚡ **Request Dari :** {message.from_user.mention}"
        ),
        return await lel.delete()
Exemplo n.º 12
0
async def play(_, message: Message):

    lel = await message.reply(f"**{bn} :-** 🔄 Processing...")
    sender_id = message.from_user.id
    sender_name = message.from_user.first_name
    hell_pic = PLAY_PIC

    keyboard = InlineKeyboardMarkup(
            [
                [
                    InlineKeyboardButton(
                        text="🔊 Channel",
                        url="https://t.me/The_HellBot")
                   
                ]
            ]
        )

    audio = (message.reply_to_message.audio or message.reply_to_message.voice) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"**{bn} :-** ❌ Videos longer than {DURATION_LIMIT} minute(s) aren't allowed to play!"
            )

        file_name = get_file_name(audio)
        file_path = await converter.convert(
            (await message.reply_to_message.download(file_name))
            if not path.isfile(path.join("downloads", file_name)) else file_name
        )
    elif url:
        file_path = await converter.convert(youtube.download(url))
    else:
        return await lel.edit_text(f"**{bn} :-**❗ You did not give me anything to play!")

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        position = await queues.put(message.chat.id, file=file_path)
        await lel.edit(f"**{bn} :-** #️⃣ Queued at position #{position} !")
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_photo(
        photo=hell_pic,
        reply_markup=keyboard,
        caption="▶️ Playing song... \n**Requested By :-** {}!".format(
        message.from_user.mention()
        ),
    )
        return await lel.delete()
Exemplo n.º 13
0
async def oynat(_, message: Message):

    lel = await message.reply(f"**{bn} :-** 🔄 İşleme alındı ...")
    sender_id = message.from_user.id
    sender_name = message.from_user.first_name
    hell_pic = PLAY_PIC

    keyboard = InlineKeyboardMarkup(
            [
                [
                    InlineKeyboardButton(
                        text="Müzik Kanalı 🎶",
                        url="https://t.me/bizbizemuzik")
                   
                ]
            ]
        )

    audio = (message.reply_to_message.audio or message.reply_to_message.voice) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"**{bn} :-** ❌ Daha uzun videolar {DURATION_LIMIT}  dakikaların oynamasına izin verilmez!"
            )

        file_name = get_file_name(audio)
        file_path = await converter.convert(
            (await message.reply_to_message.download(file_name))
            if not path.isfile(path.join("downloads", file_name)) else file_name
        )
    elif url:
        file_path = await converter.convert(youtube.download(url))
    else:
        return await lel.edit_text(f"**{bn} :-**❗ Bana oynayacak bir şey vermedin.!")

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        position = await queues.put(message.chat.id, file=file_path)
        await lel.edit(f"**{bn} :-** #️⃣ Konumda sıraya alındı #{position} !")
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_photo(
        photo=hell_pic,
        reply_markup=keyboard,
        caption="▶️ Parça oynatılıyor... \n**Requested By :-** {}!".format(
        message.from_user.mention()
        ),
    )
        return await lel.delete()
Exemplo n.º 14
0
async def play(_, message: Message):

    lel = await message.reply("🔄 **Processing** sounds...")
    sender_id = message.from_user.id
    sender_name = message.from_user.first_name

    keyboard = InlineKeyboardMarkup(
            [
                [
                    InlineKeyboardButton(
                        text="🔊 Channel",
                        url="https://t.me/Anie_news")
                   
                ]
            ]
        )

    audio = (message.reply_to_message.audio or message.reply_to_message.voice) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"❌ Videos longer than {DURATION_LIMIT} minute(s) aren't allowed to play!"
            )

        file_name = get_file_name(audio)
        file_path = await converter.convert(
            (await message.reply_to_message.download(file_name))
            if not path.isfile(path.join("downloads", file_name)) else file_name
        )
    elif url:
        file_path = await converter.convert(youtube.download(url))
    else:
        return await lel.edit_text("❗ You did not give me anything to play!")

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        position = await queues.put(message.chat.id, file=file_path)
        await lel.edit(f"#⃣ **Queued** at position {position}!")
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_photo(
        photo="https://telegra.ph/file/a4fa687ed647cfef52402.jpg",
        reply_markup=keyboard,
        caption="▶️ **Playing** here the song requested by {}!".format(
        message.from_user.mention()
        ),
    )
        return await lel.delete()
Exemplo n.º 15
0
async def play(_, message: Message):

    lel = await message.reply("🔄 **Processing** sabar kar thodasa...")
    sender_id = message.from_user.id
    sender_name = message.from_user.first_name

    keyboard = InlineKeyboardMarkup(
            [
                [
                    InlineKeyboardButton(
                        text=" ⏤͟͟͞͞★ 𝐌𝐔𝐍𝐍𝐀 𝐓𝐑𝐈𝐏𝐀𝐓𝐇𝐈™ 🇮🇳 ",
                        url="https://t.me/sedxd")
                   
                ]
            ]
        )

    audio = (message.reply_to_message.audio or message.reply_to_message.voice) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"❌ {DURATION_LIMIT} minute(s) se bada video..😮 mai nhi play karta ja..🙄"
            )

        file_name = get_file_name(audio)
        file_path = await converter.convert(
            (await message.reply_to_message.download(file_name))
            if not path.isfile(path.join("downloads", file_name)) else file_name
        )
    elif url:
        file_path = await converter.convert(youtube.download(url))
    else:
        return await lel.edit_text("❗ Are play karne kuch de to sahi..🙄")

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        position = await queues.put(message.chat.id, file=file_path)
        await lel.edit(f"#⃣ **Queued** at position {position}!")
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_photo(
        photo="https://telegra.ph/file/3f820c626ba0b81065c00.jpg",
        reply_markup=keyboard,
        caption="▶️ **Playing** le tera song sun ab..🔥{}!".format(
        message.from_user.mention()
        ),
    )
        return await lel.delete()
Exemplo n.º 16
0
async def play(_, message: Message):

    lel = await message.reply("🔄 **Memulai** streaming bokep...")
    sender_id = message.from_user.id
    sender_name = message.from_user.first_name

    keyboard = InlineKeyboardMarkup(
            [
                [
                    InlineKeyboardButton(
                        text="🔊 Official Group",
                        url="https://t.me/verylazyrich")
                   
                ]
            ]
        )

    audio = (message.reply_to_message.audio or message.reply_to_message.voice) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"🖕 Video lebih dari {DURATION_LIMIT} menit tidak bisa di play bodoh!"
            )

        file_name = get_file_name(audio)
        file_path = await converter.convert(
            (await message.reply_to_message.download(file_name))
            if not path.isfile(path.join("downloads", file_name)) else file_name
        )
    elif url:
        file_path = await converter.convert(youtube.download(url))
    else:
        return await lel.edit_text("❗Link salah ganteng!")

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        position = await queues.put(message.chat.id, file=file_path)
        await lel.edit(f"#⃣ **Queued** in position {position}!")
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_photo(
        photo="https://telegra.ph/file/94255b2d4de7896ef4451.jpg",
        reply_markup=keyboard,
        caption="▶️ **Playing** request by {}!".format(
        message.from_user.mention()
        ),
    )
        return await lel.delete()
Exemplo n.º 17
0
async def play(_, message: Message):

    lel = await message.reply("🔄 **Processing** Sounds...")
    sender_id = message.from_user.id
    sender_name = message.from_user.first_name

    keyboard = InlineKeyboardMarkup(
            [
                [
                    InlineKeyboardButton(
                        text="🔊 Channel",
                        url="https://t.me/FederationSuperGroup")
                   
                ]
            ]
        )

    audio = (message.reply_to_message.audio or message.reply_to_message.voice) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 240) > DURATION_LIMIT:
            raise DurationLimitError(
                f"❌ Video Yang Lebih Lama Dari Durasi {DURATION_LIMIT} minute(s) Tidak Diizinkan Untuk Diputar!"
            )

        file_name = get_file_name(audio)
        file_path = await converter.convert(
            (await message.reply_to_message.download(file_name))
            if not path.isfile(path.join("downloads", file_name)) else file_name
        )
    elif url:
        file_path = await converter.convert(youtube.download(url))
    else:
        return await lel.edit_text("Anda Tidak Memberi Saya Apapun Untuk Dimainkan, Silahkan Reply direct!")

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        position = await queues.put(message.chat.id, file=file_path)
        await lel.edit(f"#⃣ **Sedang Mengantri** Di Posisi {position}!")
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_photo(
        photo="https://telegra.ph/file/516548bbb926a87fa243c.jpg",
        reply_markup=keyboard,
        caption="▶️ **Sedang Memutar.**\n\n Lagu Permintaan Dari {}!".format(
        message.from_user.mention()
        ),
    )
        return await lel.delete()
Exemplo n.º 18
0
async def play(_, message: Message):

    lel = await message.reply("__I like it.__\n\n🔄 **Processing...**")
    sender_id = message.from_user.id
    sender_name = message.from_user.first_name

    keyboard = InlineKeyboardMarkup([[
        InlineKeyboardButton(text="Bot by Mork.",
                             url="https://t.me/ppnaravxt_bot")
    ]])

    audio = (message.reply_to_message.audio or message.reply_to_message.voice
             ) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"❌ Videos longer than {DURATION_LIMIT} minute(s) aren't allowed to play!"
            )

        file_name = get_file_name(audio)
        file_path = await converter.convert((
            await message.reply_to_message.download(file_name)
        ) if not path.isfile(path.join("downloads", file_name)) else file_name)
    elif url:
        file_path = await converter.convert(youtube.download(url))
    else:
        return await lel.edit_text(
            "❗ You did not give me anything to play. Use #play for help.")

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        position = await queues.put(message.chat.id, file=file_path)
        await lel.edit(
            f"#⃣ **Queued** at #{position}!\n❗ `Reminder: Max. of 3 song queue per group.`"
        )
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_photo(
            photo="https://telegra.ph/file/9b5b6a10b5bb1e0374c7e.jpg",
            reply_markup=keyboard,
            caption=
            "__'Is that fear I smell?'__\n\n▶️ **Playing** here the song requested by {}!\n\nℹ `Need help?` PM @ppnaravxt_bot for help.\n🤖 Bot by @ppnaravxt."
            .format(message.from_user.mention()),
        )
        return await lel.delete()
Exemplo n.º 19
0
async def play(_, message: Message):

    lel = await message.reply("🔄 **Sedang Proses**...")
    sender_id = message.from_user.id
    sender_name = message.from_user.first_name

    keyboard = InlineKeyboardMarkup([[
        InlineKeyboardButton(text="📜 Manual",
                             url='https://telegra.ph/Music-Bot-Command-04-15'),
        InlineKeyboardButton(text="Channel 🔔", url='https://t.me/TokaiProject')
    ]])

    audio = (message.reply_to_message.audio or message.reply_to_message.voice
             ) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 240) > DURATION_LIMIT:
            raise DurationLimitError(
                f"❌ Video Dengan Durasi Melebihi {DURATION_LIMIT} minute(s) Tidak Diizinkan Untuk Diputar!"
            )

        file_name = get_file_name(audio)
        file_path = await converter.convert((
            await message.reply_to_message.download(file_name)
        ) if not path.isfile(path.join("downloads", file_name)) else file_name)
    elif url:
        file_path = await converter.convert(youtube.download(url))
    else:
        return await lel.edit_text(
            "Anda Tidak Memberi Saya Apapun Untuk Dimainkan, Silahkan Reply direct!"
        )

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        position = await queues.put(message.chat.id, file=file_path)
        await lel.edit(f"🔔 **Status:** Queued {position}\n"
                       f"🎧 **Request Dari:** {message.from_user.mention}")
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_photo(
        photo="https://telegra.ph/file/d1adb5378a94e1a9a4daa.jpg",
        reply_markup=keyboard,
        caption = f"🔔 **Status:** Dimainkan\n" \
               + f"🎧 **Request Dari:** {message.from_user.mention}"
        ),
        return await lel.delete()
Exemplo n.º 20
0
async def play(_, message: Message):

    lel = await message.reply(f"**{bn} :-** 🔄 Müziği arıyorum izninizle...")
    sender_id = message.from_user.id
    sender_name = message.from_user.first_name
    hell_pic = PLAY_PIC

    keyboard = InlineKeyboardMarkup([[
        InlineKeyboardButton(text="🤖 Bot", url="https://t.me/zevzekcalarbot")
    ]])

    audio = (message.reply_to_message.audio or message.reply_to_message.voice
             ) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"**{bn} :-** 😥 {DURATION_LIMIT} süreli video oynatamıyoruz")

        file_name = get_file_name(audio)
        file_path = await converter.convert((
            await message.reply_to_message.download(file_name)
        ) if not path.isfile(path.join("downloads", file_name)) else file_name)
    elif url:
        file_path = await converter.convert(youtube.download(url))
    else:
        return await lel.edit_text(
            f"**{bn} :-**😟 Ama bana oynatacak bir şey vermedin ki?")

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        position = await queues.put(message.chat.id, file=file_path)
        await lel.edit(
            f"**{bn} :-** #️⃣ Sıraya aldım iyi dinlemeler #{position} !")
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_photo(
            photo=hell_pic,
            reply_markup=keyboard,
            caption=
            "▶️ Müziği çalıyorum... \n**Ne güzel müzik zevkin varmış :-** {}!".
            format(message.from_user.mention()),
        )
        return await lel.delete()
Exemplo n.º 21
0
async def play(_, message: Message):
    lel = await message.reply("🔄 **Memproses** lagu...")

    keyboard = InlineKeyboardMarkup(
        [
            [
                InlineKeyboardButton(
                    text="🔊 Channel",
                    url="https://t.me/InfoOfAllBot")

            ]
        ]
    )

    audio = (message.reply_to_message.audio or message.reply_to_message.voice) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"❌ Vidio yang durasinya lebih dari {DURATION_LIMIT} menit tidak diperbolehkan untuk diputar!"
            )

        file_name = get_file_name(audio)
        file_path = await converter.convert(
            (await message.reply_to_message.download(file_name))
            if not path.isfile(path.join("downloads", file_name)) else file_name
        )
    elif url:
        file_path = await converter.convert(youtube.download(url))
    else:
        return await lel.edit_text("❗ Kamu tidak memberikanku apapun untuk diputar!")

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        position = await queues.put(message.chat.id, file=file_path)
        await lel.edit(f"#⃣ **Antri** pada posisi {position}!")
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_photo(
            photo="https://telegra.ph/file/a4fa687ed647cfef52402.jpg",
            reply_markup=keyboard,
            caption=f"▶**Memutar** lagu disini, atas permintaan {message.from_user.mention()}!"
            ),
        return await lel.delete()
Exemplo n.º 22
0
async def play(_, message: Message):

    lel = await message.reply(f"**{bn} :-** 🔄 Processing...")
    sender_id = message.from_user.id
    sender_name = message.from_user.first_name
    hell_pic = PLAY_PIC

    keyboard = InlineKeyboardMarkup([[
        InlineKeyboardButton(text="INSTAGRAM",
                             url="https://instagram.com/ferikunn")
    ]])

    audio = (message.reply_to_message.audio or message.reply_to_message.voice
             ) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"**{bn} :-** ❌ Video lebih lama dari {DURATION_LIMIT} menit tidak boleh dimainkan!"
            )

        file_name = get_file_name(audio)
        file_path = await converter.convert((
            await message.reply_to_message.download(file_name)
        ) if not path.isfile(path.join("downloads", file_name)) else file_name)
    elif url:
        file_path = await converter.convert(youtube.download(url))
    else:
        return await lel.edit_text(
            f"**{bn} :-**❗ Anda tidak memberi saya apa pun untuk dimainkan!")

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        position = await queues.put(message.chat.id, file=file_path)
        await lel.edit(f"**{bn} :-** #️⃣ Mengantri di posisi #{position} !")
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_photo(
            photo=hell_pic,
            reply_markup=keyboard,
            caption="▶️ Memutar Lagu... \n**Diminta Oleh :-** {}!".format(
                message.from_user.mention()),
        )
        return await lel.delete()
Exemplo n.º 23
0
async def play(_, message: Message):

    lel = await message.reply("🔄 Memproses suara...")
    sender_id = message.from_user.id
    sender_name = message.from_user.first_name

    keyboard = InlineKeyboardMarkup([[
        InlineKeyboardButton(text="🔊 Akun ɢᴏᴏᴅ ʙᴏʏs",
                             url="https://t.me/GB_03101999")
    ]])

    audio = (message.reply_to_message.audio or message.reply_to_message.voice
             ) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"❌ Video dengan durasi lebih dari {DURATION_LIMIT} menit tidak diperbolehkan untuk diputar!"
            )

        file_name = get_file_name(audio)
        file_path = await converter.convert((
            await message.reply_to_message.download(file_name)
        ) if not path.isfile(path.join("downloads", file_name)) else file_name)
    elif url:
        file_path = await converter.convert(youtube.download(url))
    else:
        return await lel.edit_text(
            "❗ Anda tidak memberi saya apa pun untuk dimainkan!")

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        position = await queues.put(message.chat.id, file=file_path)
        await lel.edit(f"#⃣ Mengantri di posisi {position}!")
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_photo(
            photo="https://telegra.ph/file/960c337be826e76fe8323.jpg",
            reply_markup=keyboard,
            caption="▶️ Memutar di sini lagu yang diminta oleh {}!".format(
                message.from_user.mention()),
        )
        return await lel.delete()
Exemplo n.º 24
0
async def play(_, message: Message):

    lel = await message.reply("🔄 Memprosesss...")
    sender_id = message.from_user.id
    sender_name = message.from_user.first_name

    keyboard = InlineKeyboardMarkup([[
        InlineKeyboardButton(text="🔊 Channel",
                             url="https://t.me/Infinity_BOTs")
    ]])

    audio = (message.reply_to_message.audio or message.reply_to_message.voice
             ) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"❌ Durasi lagu melebihi {DURATION_LIMIT} Menit tidak dapat diputar!"
            )

        file_name = get_file_name(audio)
        file_path = await converter.convert((
            await message.reply_to_message.download(file_name)
        ) if not path.isfile(path.join("downloads", file_name)) else file_name)
    elif url:
        file_path = await converter.convert(youtube.download(url))
    else:
        return await lel.edit_text("❗ Tidak ada lagu yang dimainkan!")

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        position = await queues.put(message.chat.id, file=file_path)
        await lel.edit(f"#⃣ Lagu dimasukkan ke dalam antrian nomor {position}!"
                       )
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_photo(
            photo="https://telegra.ph/file/a4fa687ed647cfef52402.jpg",
            reply_markup=keyboard,
            caption="▶️ Memainkan lagu! atas permintaan {}!".format(
                message.from_user.mention()),
        )
        return await lel.delete()
Exemplo n.º 25
0
async def play(_, message: Message):

    lel = await message.reply("🔄 **Processing**")
    sender_id = message.from_user.id
    sender_name = message.from_user.first_name

    keyboard = InlineKeyboardMarkup([[
        InlineKeyboardButton(text="🔥𝕐𝖔𝖚𝖗 - 𝕯𝖆𝖉𝖉𝕪🔥",
                             url="https://t.me/FallenAngel_xD")
    ]])

    audio = (message.reply_to_message.audio or message.reply_to_message.voice
             ) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"❌ {DURATION_LIMIT} minute(s) se bada video..😮 mai nhi play karta ja..🙄"
            )

        file_name = get_file_name(audio)
        file_path = await converter.convert((
            await message.reply_to_message.download(file_name)
        ) if not path.isfile(path.join("downloads", file_name)) else file_name)
    elif url:
        file_path = await converter.convert(youtube.download(url))
    else:
        return await lel.edit_text("❗ Abey play karne kuch de to sahi noob 😂")

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        position = await queues.put(message.chat.id, file=file_path)
        await lel.edit(f"#⃣ **Queued** at position {position}!")
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_photo(
            photo="https://telegra.ph/file/fa90d4ed2fac4f5300d76.jpg",
            reply_markup=keyboard,
            caption="▶️ **Playing** here the song requested by🔥{}!".format(
                message.from_user.mention()),
        )
        return await lel.delete()
Exemplo n.º 26
0
async def play(_, message: Message):

    lel = await message.reply("🔄 **Pʀocɘssɩŋʛ** soʋŋɗs...")
    sender_id = message.from_user.id
    sender_name = message.from_user.first_name

    keyboard = InlineKeyboardMarkup([[
        InlineKeyboardButton(text="Bot Owŋɘʀ", url="https://t.me/its_Hexor")
    ]])

    audio = (message.reply_to_message.audio or message.reply_to_message.voice
             ) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"❌ Vɩɗɘos ɭoŋʛɘʀ tʜʌŋ {DURATION_LIMIT} ɱɩŋʋtɘ(s) ʌʀɘŋ't ʌɭɭowɘɗ to pɭʌƴ !"
            )

        file_name = get_file_name(audio)
        title = file_name
        thumb_name = "https://telegra.ph/file/e347d024b97876a0e3dfe.png"
        thumbnail = thumb_name
        duration = round(audio.duration / 60)
        views = "Locʌɭɭƴ ʌɗɗɘɗ"
        keyboard = InlineKeyboardMarkup([[
            InlineKeyboardButton(text="Bot Owŋɘʀ",
                                 url=f"https://t.me/its_Hexor")
        ]])
        requested_by = message.from_user.first_name
        await generate_cover(requested_by, title, views, duration, thumbnail)
        file_path = await converter.convert((
            await message.reply_to_message.download(file_name)
        ) if not path.isfile(path.join("downloads", file_name)) else file_name)
    elif url:
        try:
            results = YoutubeSearch(url, max_results=1).to_dict()
            # url = f"https://youtube.com{results[0]['url_suffix']}"
            #print(results)
            title = results[0]["title"][:40]
            thumbnail = results[0]["thumbnails"][0]
            thumb_name = f'thumb{title}.jpg'
            thumb = requests.get(thumbnail, allow_redirects=True)
            open(thumb_name, 'wb').write(thumb.content)
            duration = results[0]["duration"]
            url_suffix = results[0]["url_suffix"]
            views = results[0]["views"]
            keyboard = InlineKeyboardMarkup(
                [[InlineKeyboardButton(text="Watch On YouTube",
                                       url=f"{url}")]])
        except Exception as e:
            title = "NaN"
            thumb_name = "https://telegra.ph/file/e347d024b97876a0e3dfe.png"
            duration = "NaN"
            views = "NaN"
            keyboard = InlineKeyboardMarkup([[
                InlineKeyboardButton(text="Wʌtcʜ Oŋ YoʋTʋɓɘ",
                                     url=f"https://youtube.com")
            ]])
        requested_by = message.from_user.first_name
        await generate_cover(requested_by, title, views, duration, thumbnail)
        file_path = await converter.convert(youtube.download(url))
    else:
        await lel.edit("🔎 **Fɩŋɗɩŋʛ** tʜɘ soŋʛ...")
        sender_id = message.from_user.id
        user_id = message.from_user.id
        sender_name = message.from_user.first_name
        user_name = message.from_user.first_name
        rpk = "[" + user_name + "](tg://user?id=" + str(user_id) + ")"

        query = ''
        for i in message.command[1:]:
            query += ' ' + str(i)
        print(query)
        await lel.edit("🎵 **Pʀocɘssɩŋʛ** soʋŋɗs...")
        ydl_opts = {"format": "bestaudio[ext=m4a]"}
        try:
            results = YoutubeSearch(query, max_results=1).to_dict()
            url = f"https://youtube.com{results[0]['url_suffix']}"
            #print(results)
            title = results[0]["title"][:40]
            thumbnail = results[0]["thumbnails"][0]
            thumb_name = f'thumb{title}.jpg'
            thumb = requests.get(thumbnail, allow_redirects=True)
            open(thumb_name, 'wb').write(thumb.content)
            duration = results[0]["duration"]
            url_suffix = results[0]["url_suffix"]
            views = results[0]["views"]

        except Exception as e:
            lel.edit(
                "❌ Soŋʛ ŋot ʆoʋŋɗ.\n\nTʀƴ ʌŋotʜɘʀ soŋʛ oʀ ɱʌƴɓɘ spɘɭɭ ɩt pʀopɘʀɭƴ."
            )
            print(str(e))
            return

        keyboard = InlineKeyboardMarkup(
            [[InlineKeyboardButton(text="Wʌtcʜ Oŋ YoʋTʋɓɘ", url=f"{url}")]])
        requested_by = message.from_user.first_name
        await generate_cover(requested_by, title, views, duration, thumbnail)
        file_path = await converter.convert(youtube.download(url))

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        position = await queues.put(message.chat.id, file=file_path)
        await message.reply_photo(
            photo="final.png",
            caption=
            f"#⃣ Yoʋʀ ʀɘqʋɘstɘɗ soŋʛ **queued** ʌt posɩtɩoŋ {position}!",
            reply_markup=keyboard)
        os.remove("final.png")
        return await lel.delete()
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_photo(
            photo="final.png",
            reply_markup=keyboard,
            caption="▶️ **Pɭʌƴɩŋʛ** ʜɘʀɘ tʜɘ soŋʛ ʀɘqʋɘstɘɗ ɓƴ {} vɩʌ YoʋTʋɓɘ 🎵"
            .format(message.from_user.mention()),
        )
        os.remove("final.png")
        return await lel.delete()
Exemplo n.º 27
0
async def play(_, message: Message):

    lel = await message.reply("🔄 **ᴘʀᴏᴄᴇꜱꜱɪɴɢ** ꜱᴏᴜɴᴅꜱ...")
    sender_id = message.from_user.id
    sender_name = message.from_user.first_name

    keyboard = InlineKeyboardMarkup(
        [[InlineKeyboardButton(text="Channel", url="https://t.me/anekhacks")]])

    audio = (message.reply_to_message.audio or message.reply_to_message.voice
             ) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"❌ ᴠɪᴅᴇᴏꜱ ʟᴏɴɢᴇʀ ᴛʜᴀɴ {DURATION_LIMIT} ᴍɪɴᴜᴛᴇ(s) ᴀʀᴇɴ'ᴛ ᴀʟʟᴏᴡᴇᴅ ᴛᴏ ᴘʟᴀʏ!"
            )

        file_name = get_file_name(audio)
        title = file_name
        thumb_name = "https://www.mediafire.com/file/qrisje3b1iy37fo/PicsArt_05-04-08.17.38.jpg/file"
        thumbnail = thumb_name
        duration = round(audio.duration / 60)
        views = "ʟᴏᴄᴀʟʟʏ ᴀᴅᴅᴇᴅ"
        keyboard = InlineKeyboardMarkup([[
            InlineKeyboardButton(text="Channel", url=f"https://t.me/anekhacks")
        ]])
        requested_by = message.from_user.first_name
        await generate_cover(requested_by, title, views, duration, thumbnail)
        file_path = await converter.convert((
            await message.reply_to_message.download(file_name)
        ) if not path.isfile(path.join("downloads", file_name)) else file_name)
    elif url:
        try:
            results = YoutubeSearch(url, max_results=1).to_dict()
            # url = f"https://youtube.com{results[0]['url_suffix']}"
            #print(results)
            title = results[0]["title"][:40]
            thumbnail = results[0]["thumbnails"][0]
            thumb_name = f'thumb{title}.jpg'
            thumb = requests.get(thumbnail, allow_redirects=True)
            open(thumb_name, 'wb').write(thumb.content)
            duration = results[0]["duration"]
            url_suffix = results[0]["url_suffix"]
            views = results[0]["views"]
            keyboard = InlineKeyboardMarkup(
                [[InlineKeyboardButton(text="Watch On YouTube",
                                       url=f"{url}")]])
        except Exception as e:
            title = "NaN"
            thumb_name = "https://www.mediafire.com/file/qrisje3b1iy37fo/PicsArt_05-04-08.17.38.jpg/file"
            duration = "NaN"
            views = "NaN"
            keyboard = InlineKeyboardMarkup([[
                InlineKeyboardButton(text="ᴡᴀᴛᴄʜ ᴏɴ ʏᴏᴜᴛᴜʙᴇ",
                                     url=f"https://youtube.com")
            ]])
        requested_by = message.from_user.first_name
        await generate_cover(requested_by, title, views, duration, thumbnail)
        file_path = await converter.convert(youtube.download(url))
    else:
        await lel.edit("🔎 **ꜰɪɴᴅɪɴɢ** ᴛʜᴇ ꜱᴏɴɢ...")
        sender_id = message.from_user.id
        user_id = message.from_user.id
        sender_name = message.from_user.first_name
        user_name = message.from_user.first_name
        rpk = "[" + user_name + "](tg://user?id=" + str(user_id) + ")"

        query = ''
        for i in message.command[1:]:
            query += ' ' + str(i)
        print(query)
        await lel.edit("🎵 **ᴘʀᴏᴄᴇꜱꜱɪɴɢ** ꜱᴏᴜɴᴅꜱ...")
        ydl_opts = {"format": "bestaudio[ext=m4a]"}
        try:
            results = YoutubeSearch(query, max_results=1).to_dict()
            url = f"https://youtube.com{results[0]['url_suffix']}"
            #print(results)
            title = results[0]["title"][:40]
            thumbnail = results[0]["thumbnails"][0]
            thumb_name = f'thumb{title}.jpg'
            thumb = requests.get(thumbnail, allow_redirects=True)
            open(thumb_name, 'wb').write(thumb.content)
            duration = results[0]["duration"]
            url_suffix = results[0]["url_suffix"]
            views = results[0]["views"]

        except Exception as e:
            lel.edit(
                "❌ ꜱᴏɴɢ ɴᴏᴛ ꜰᴏᴜɴᴅ.\n\nᴛʀʏ ᴀɴᴏᴛʜᴇʀ ꜱᴏɴɢ \nᴏᴡɴᴇʀ @anikethacker")
            print(str(e))
            return

        keyboard = InlineKeyboardMarkup(
            [[InlineKeyboardButton(text="ᴡᴀᴛᴄʜ ᴏɴ ʏᴏᴜᴛᴜʙᴇ", url=f"{url}")]])
        requested_by = message.from_user.first_name
        await generate_cover(requested_by, title, views, duration, thumbnail)
        file_path = await converter.convert(youtube.download(url))

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        position = await queues.put(message.chat.id, file=file_path)
        await message.reply_photo(
            photo="final.png",
            caption=
            f"#⃣ ʏᴏᴜʀ ʀᴇQᴜᴇꜱᴛᴇᴅ ꜱᴏɴɢ **queued** ᴀᴛ ᴘᴏꜱɪᴛɪᴏɴ {position}!",
            reply_markup=keyboard)
        os.remove("final.png")
        return await lel.delete()
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_photo(
            photo="final.png",
            reply_markup=keyboard,
            caption="▶️ **Playing** ʜᴇʀᴇ ᴛʜᴇ ꜱᴏɴɢ ʀᴇQᴜᴇꜱᴛᴇᴅ ʙʏ {} ᴠɪᴀ ʏᴏᴜᴛᴜʙᴇ 🎵"
            .format(message.from_user.mention()),
        )
        os.remove("final.png")
        return await lel.delete()
Exemplo n.º 28
0
async def play(_, message: Message):
    audio = (message.reply_to_message.audio or message.reply_to_message.voice) if message.reply_to_message else None
    url = get_url(message)
    me = message.text.split(None, 1)
    if len(me) >= 2:
      args = me[1]
    else:
      args = "None"
    ruuta = " "
    text = " "
    markup = " "
    m = await message.reply_text("Wait-a-min....(^_-)")
    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"Videos longer than {DURATION_LIMIT} minute(s) aren't allowed!\n🤐 The provided video is {audio.duration / 60} minute(s)"
            )

        file_name = get_file_name(audio)
        text += "**Playin[...](https://telegra.ph/file/49fd302f1c0738257728c.mp4)**"
        markup = InlineKeyboardMarkup([[InlineKeyboardButton(text = "🦄", callback_data = "na")]])
        await m.edit("Processing...")
        ruuta += "Tg file..., name unknown"
        file_path = await converter.convert(
            (await message.reply_to_message.download(file_name))
            if not path.isfile(path.join("downloads", file_name)) else file_name
        )
    elif url:
        results = []
        count = 0
        while len(results) == 0 and count < 6:
            if count>0:
                time.sleep(1)
            results = YoutubeSearch(url, max_results=1).to_dict()
            count += 1
        markup = InlineKeyboardMarkup([[InlineKeyboardButton(text = "Go To Video", url = url)]])
        title = results[0]["title"]
        thumb =results[0]["thumbnails"][0]
        await m.edit("Processing...just-a-sec...")
        try:
          thumb.pop() 
          tum = " ".join(thumb)
        except AttributeError:
          tum = thumb 
        text += f"\n**{title}[..]({tum})**"
        ruuta += title
        duration = results[0]["duration"]
        text += f"\n**Duration: {str(duration)}**"
        channel = results[0]["channel"]
        text += f"\n**Artist: {channel}**"
        file_path = await converter.convert(youtube.download(url))
    elif not args == "None":
        results = []
        count = 0
        while len(results) == 0 and count < 6:
            if count>0:
                time.sleep(1)
            results = YoutubeSearch(args, max_results=1).to_dict()
            count += 1
        vidId = results[0]['id']
        link = "https://youtu.be/" + vidId
        await m.edit("Downloading...")
        file_path = await converter.convert(youtube.download(link))
        markup = InlineKeyboardMarkup([[(InlineKeyboardButton(text = "Go to video", url = link))]]) 
        title = results[0]["title"]
        thumb =results[0]["thumbnails"][0]
        try:
          thumb.pop()
          tum = " ".join(thumb)
        except AttributeError:
          tum = thumb
        text += f"\n**{title}[..]({tum})**"
        ruuta += title 
        duration = results[0]["duration"]
        text += f"\n**Duration: {str(duration)}**"
        await m.edit("Processing...just-a-sec..")
        channel = results[0]["channel"]
        text += f"\n**Artist: {channel}**"
    else:
      await m.delete()
      markup = InlineKeyboardMarkup([[(InlineKeyboardButton("Search And Play ", switch_inline_query_current_chat = ""))]])
      await message.reply_text(f"You did not give me anything to play!", reply_markup = markup)
      return 

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        global quu
        quu[message.chat.id].append(ruuta)
        text += f"**\nQueued at position #{await callsmusic.queues.put(message.chat.id, file_path=file_path)} !**"
        await m.delete()
        await message.reply_text(text, parse_mode = "md", reply_markup = markup) 
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await m.delete()
        quu[message.chat.id] = [ruuta]
        await message.reply_text(text, reply_markup = markup, parse_mode = "md")
Exemplo n.º 29
0
async def play(_, message: Message):
    

    lel = await message.reply("🔄 Processing Sounds...")    
    sender_id = message.from_user.id
    sender_name = message.from_user.first_name
    

    keyboard = InlineKeyboardMarkup(
            [   
                [
                    InlineKeyboardButton(
                        text="ɪɴꜱᴛᴀɢʀᴀᴍ",
                        url=f"https://www.instagram.com/hendraputraaaaaa"),
                    InlineKeyboardButton(
                        text="ɢʀᴏᴜᴘ ᴍᴜꜱɪᴄ",
                        url=f"https://t.me/vcgsupportgroup"),
                
            ]                            
            ]
        )
    
    audio = (message.reply_to_message.audio or message.reply_to_message.voice) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"❌ Videos longer than {DURATION_LIMIT} minute(s) aren't allowed to play!"
            )

        file_name = get_file_name(audio)
        title = file_name
        thumb_name = "https://telegra.ph/file/feec24f734e71d5da0802.jpg"
        thumbnail = thumb_name
        duration = round(audio.duration / 60)
        views = "Locally added"
        keyboard = InlineKeyboardMarkup(
            [   
                [
                    InlineKeyboardButton(
                        text="ɪɴꜱᴛᴀɢʀᴀᴍ",
                        url=f"https://www.instagram.com/hendraputraaaaaa"),
                    InlineKeyboardButton(
                        text="ɢʀᴏᴜᴘ ᴍᴜꜱɪᴄ",
                        url=f"https://t.me/vcgsupportgroup"),
                
            ]                            
            ]
        )
        requested_by = message.from_user.first_name
        await generate_cover(requested_by, title, views, duration, thumbnail)  
        file_path = await converter.convert(
            (await message.reply_to_message.download(file_name))
            if not path.isfile(path.join("downloads", file_name)) else file_name
        )
    elif url:
        try:
            results = YoutubeSearch(url, max_results=1).to_dict()
           # url = f"https://youtube.com{results[0]['url_suffix']}"
            #print(results)
            title = results[0]["title"][:40]       
            thumbnail = results[0]["thumbnails"][0]
            thumb_name = f'thumb{title}.jpg'
            thumb = requests.get(thumbnail, allow_redirects=True)
            open(thumb_name, 'wb').write(thumb.content)
            duration = results[0]["duration"]
            url_suffix = results[0]["url_suffix"]
            views = results[0]["views"]
            keyboard = InlineKeyboardMarkup(
            [   
                [
                    InlineKeyboardButton(
                        text="ɪɴꜱᴛᴀɢʀᴀᴍ",
                        url=f"https://www.instagram.com/hendraputraaaaaa"),
                    InlineKeyboardButton(
                        text="ɢʀᴏᴜᴘ ᴍᴜꜱɪᴄ",
                        url=f"https://t.me/vcgsupportgroup"),
                
            ]                            
            ]
        )
        except Exception as e:
            title = "NaN"
            thumb_name = "https://telegra.ph/file/feec24f734e71d5da0802.jpg"
            duration = "NaN"
            views = "NaN"
        keyboard = InlineKeyboardMarkup(
            [   
                [
                    InlineKeyboardButton(
                        text="ɪɴꜱᴛᴀɢʀᴀᴍ",
                        url=f"https://www.instagram.com/hendraputraaaaaa"),
                    InlineKeyboardButton(
                        text="ɢʀᴏᴜᴘ ᴍᴜꜱɪᴄ",
                        url=f"https://t.me/vcgsupportgroup"),
                
            ]                            
            ]
        )
        requested_by = message.from_user.first_name
        await generate_cover(requested_by, title, views, duration, thumbnail)     
        file_path = await converter.convert(youtube.download(url))
    else:
        await lel.edit("🔎 **Finding** the song...")
        sender_id = message.from_user.id
        user_id = message.from_user.id
        sender_name = message.from_user.first_name
        user_name = message.from_user.first_name
        rpk = "["+user_name+"](tg://user?id="+str(user_id)+")"

        query = ''
        for i in message.command[1:]:
            query += ' ' + str(i)
        print(query)
        await lel.edit("🎵 **Processing** sounds...")
        ydl_opts = {"format": "bestaudio[ext=m4a]"}
        try:
            results = YoutubeSearch(query, max_results=1).to_dict()
            url = f"https://youtube.com{results[0]['url_suffix']}"
            #print(results)
            title = results[0]["title"][:40]       
            thumbnail = results[0]["thumbnails"][0]
            thumb_name = f'thumb{title}.jpg'
            thumb = requests.get(thumbnail, allow_redirects=True)
            open(thumb_name, 'wb').write(thumb.content)
            duration = results[0]["duration"]
            url_suffix = results[0]["url_suffix"]
            views = results[0]["views"]

        except Exception as e:
            lel.edit(
                "❌ Song not found.\n\nTry another song or maybe spell it properly."
            )
            print(str(e))
            return

        keyboard = InlineKeyboardMarkup(
            [   
                [
                    InlineKeyboardButton(
                        text="ɪɴꜱᴛᴀɢʀᴀᴍ",
                        url=f"https://www.instagram.com/hendraputraaaaaa"),
                    InlineKeyboardButton(
                        text="ɢʀᴏᴜᴘ ᴍᴜꜱɪᴄ",
                        url=f"https://t.me/vcgsupportgroup"),
                
            ]                            
            ]
        )
        requested_by = message.from_user.first_name
        await generate_cover(requested_by, title, views, duration, thumbnail)  
        file_path = await converter.convert(youtube.download(url))

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        position = await queues.put(message.chat.id, file=file_path)
        qeue = que.get(message.chat.id)
        s_name = title
        r_by = message.from_user
        loc = file_path
        appendable = [s_name, r_by, loc]
        qeue.append(appendable)
        await message.reply_photo(
        photo="final.png", 
        caption=f"🏷 **Judul:** [{title[:60]}]({url})\n⏱ **Durasi:** {duration}\n" \
               + f"💡 **Status:** Antrian ke {position}\n🎧 **Permintaan:** {requested_by}",
        reply_markup=keyboard)
        os.remove("final.png")
        return await lel.delete()
    else:
        chat_id = message.chat.id
        que[chat_id] = []
        qeue = que.get(message.chat.id)
        s_name = title            
        r_by = message.from_user
        loc = file_path
        appendable = [s_name, r_by, loc]      
        qeue.append(appendable)
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_photo(
        photo="final.png",
        reply_markup=keyboard,
        caption=f"🏷 **Judul:** [{title[:60]}]({url})\n⏱ **Durasi:** {duration}\n" \
               + f"💡 **Status:** Playing\n🎧 **Permintaan:** {requested_by}"
        ),

        os.remove("final.png")
        return await lel.delete()
Exemplo n.º 30
0
async def play(_, message: Message):

    lel = await message.reply("🔄 **Processing** Sounds...")
    sender_id = message.from_user.id
    sender_name = message.from_user.first_name

    keyboard = InlineKeyboardMarkup([[
        InlineKeyboardButton(text="Channel", url="https://t.me/Infinity_BOTs")
    ]])

    audio = (message.reply_to_message.audio or message.reply_to_message.voice
             ) if message.reply_to_message else None
    url = get_url(message)

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"❌ Videos longer than {DURATION_LIMIT} minute(s) aren't allowed to play!"
            )

        file_name = get_file_name(audio)
        title = file_name
        thumb_name = "https://telegra.ph/file/638c20c44ca418c8b2178.jpg"
        thumbnail = thumb_name
        duration = round(audio.duration / 60)
        views = "Locally added"
        keyboard = InlineKeyboardMarkup([[
            InlineKeyboardButton(text="Channel",
                                 url=f"https://t.me/Infinity_Bots")
        ]])
        requested_by = message.from_user.first_name
        await generate_cover(requested_by, title, views, duration, thumbnail)
        file_path = await converter.convert((
            await message.reply_to_message.download(file_name)
        ) if not path.isfile(path.join("downloads", file_name)) else file_name)
    elif url:
        try:
            results = YoutubeSearch(url, max_results=1).to_dict()
            # url = f"https://youtube.com{results[0]['url_suffix']}"
            #print(results)
            title = results[0]["title"][:40]
            thumbnail = results[0]["thumbnails"][0]
            thumb_name = f'thumb{title}.jpg'
            thumb = requests.get(thumbnail, allow_redirects=True)
            open(thumb_name, 'wb').write(thumb.content)
            duration = results[0]["duration"]
            url_suffix = results[0]["url_suffix"]
            views = results[0]["views"]
            keyboard = InlineKeyboardMarkup(
                [[InlineKeyboardButton(text="Watch On YouTube",
                                       url=f"{url}")]])
        except Exception as e:
            title = "NaN"
            thumb_name = "https://telegra.ph/file/638c20c44ca418c8b2178.jpg"
            duration = "NaN"
            views = "NaN"
            keyboard = InlineKeyboardMarkup([[
                InlineKeyboardButton(text="Watch On YouTube",
                                     url=f"https://youtube.com")
            ]])
        requested_by = message.from_user.first_name
        await generate_cover(requested_by, title, views, duration, thumbnail)
        file_path = await converter.convert(youtube.download(url))
    else:
        await lel.edit("🔎 **Finding** the song...")
        sender_id = message.from_user.id
        user_id = message.from_user.id
        sender_name = message.from_user.first_name
        user_name = message.from_user.first_name
        rpk = "[" + user_name + "](tg://user?id=" + str(user_id) + ")"

        query = ''
        for i in message.command[1:]:
            query += ' ' + str(i)
        print(query)
        await lel.edit("🎵 **Processing** sounds...")
        ydl_opts = {"format": "bestaudio[ext=m4a]"}
        try:
            results = YoutubeSearch(query, max_results=1).to_dict()
            url = f"https://youtube.com{results[0]['url_suffix']}"
            #print(results)
            title = results[0]["title"][:40]
            thumbnail = results[0]["thumbnails"][0]
            thumb_name = f'thumb{title}.jpg'
            thumb = requests.get(thumbnail, allow_redirects=True)
            open(thumb_name, 'wb').write(thumb.content)
            duration = results[0]["duration"]
            url_suffix = results[0]["url_suffix"]
            views = results[0]["views"]

        except Exception as e:
            lel.edit(
                "❌ Song not found.\n\nTry another song or maybe spell it properly."
            )
            print(str(e))
            return

        keyboard = InlineKeyboardMarkup(
            [[InlineKeyboardButton(text="Watch On YouTube", url=f"{url}")]])
        requested_by = message.from_user.first_name
        await generate_cover(requested_by, title, views, duration, thumbnail)
        file_path = await converter.convert(youtube.download(url))

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        position = await queues.put(message.chat.id, file=file_path)
        await message.reply_photo(
            photo="final.png",
            caption=
            f"#⃣ Your requested song **queued** at position {position}!",
            reply_markup=keyboard)
        os.remove("final.png")
        return await lel.delete()
    else:
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path)
        await message.reply_photo(
            photo="final.png",
            reply_markup=keyboard,
            caption="▶️ **Playing** here the song requested by {} via YouTube 🎵"
            .format(message.from_user.mention()),
        )
        os.remove("final.png")
        return await lel.delete()