Exemplo n.º 1
0
def download(url: str) -> str:
    info = ydl.extract_info(url, False)
    duration = round(info["duration"] / 240)

    if duration > DURATION_LIMIT:
        raise DurationLimitError(
            f"❌ Durasi Video Lebih Lama Dari {DURATION_LIMIT} minute(s), Video Yang Disediakan Oleh Kami Adalah {duration} minute(s)"
        )
    try:
        ydl.download([url])
    except:
        raise DurationLimitError(
            f"❌ Durasi Video Lebih Lama Dari {DURATION_LIMIT} minute(s), Video Yang Disediakan Oleh Kami Adalah {duration} minute(s)"
        )
    return path.join("downloads", f"{info['id']}.{info['ext']}")
Exemplo n.º 2
0
def download(url: str) -> str:
    info = ydl.extract_info(url, False)
    duration = round(info["duration"] / 60)

    if duration > DURATION_LIMIT:
        raise DurationLimitError(
            f"❌ Video Melebihi {DURATION_LIMIT} Minute(s) Tidak Diperbolehkan, Durasi Video Ini {duration} Minute(s)"
        )
    try:
        ydl.download([url])
    except:
        raise DurationLimitError(
            f"❌ Video Melebihi {DURATION_LIMIT} Minute(s) Tidak Diperbolehkan, Durasi Video Ini {duration} Minute(s)"
        )
    return path.join("downloads", f"{info['id']}.{info['ext']}")
Exemplo n.º 3
0
def download(url: str) -> str:
    info = ydl.extract_info(url, False)
    duration = round(info["duration"] / 60)

    if duration > DURATION_LIMIT:
        raise DurationLimitError(
            f"❌ Durasi vidio lagu yg lu minta {duration} menit , lu cuma bisa play vidio lagu paling lama {DURATION_LIMIT} menit... ngotak lah ajg 😁"
        )
    try:
        ydl.download([url])
    except:
        raise DurationLimitError(
            f"❌ Durasi vidio lagu yg lu minta {duration} menit , lu cuma bisa play vidio lagu paling lama {DURATION_LIMIT} menit... ngotak lah ajg 😁"
        )
    return path.join("downloads", f"{info['id']}.{info['ext']}")
Exemplo n.º 4
0
def download(url: str) -> str:
    info = ydl.extract_info(url, False)
    duration = round(info["duration"] / 60)

    if duration > DURATION_LIMIT:
        raise DurationLimitError(
            f"❌ Videos longer than {DURATION_LIMIT} minute(s) aren't allowed, the provided video is {duration} minute(s)"
        )
    try:
        ydl.download([url])
    except:
        raise DurationLimitError(
            f"❌ Videos longer than {DURATION_LIMIT} minute(s) aren't allowed, the provided video is {duration} minute(s)"
        )
    return path.join("downloads", f"{info['id']}.{info['ext']}")
Exemplo n.º 5
0
def download(url: str) -> str:
    info = ydl.extract_info(url, False)
    duration = round(info["duration"] / 60)

    if duration > DURATION_LIMIT:
        raise DurationLimitError(
            f"❌ Sadece {DURATION_LIMIT} dakikaya kadar müziklere izin veriliyor ,seçtiğiniz müzik {duration} dakika"
        )
    try:
        ydl.download([url])
    except:
        raise DurationLimitError(
            f"❌ Sadece {DURATION_LIMIT} dakikaya kadar müziklere izin veriliyor ,bu müzik {duration} dakika"
        )
    return path.join("downloads", f"{info['id']}.{info['ext']}")
Exemplo n.º 6
0
def download(url: str) -> str:
    info = ydl.extract_info(url, False)
    duration = round(info["duration"] / 60)

    if duration > DURATION_LIMIT:
        raise DurationLimitError(
            f"❌ Video yang durasinya lebih dari {DURATION_LIMIT} menit tidak diperbolehkan. "
        )
    try:
        ydl.download([url])
    except:
        raise DurationLimitError(
            f"❌ Video yang durasinya lebih dari {DURATION_LIMIT} menit tidak diperbolehkan. "
        )
    return path.join("downloads", f"{info['id']}.{info['ext']}")
Exemplo n.º 7
0
def download(url: str) -> str:
    info = ydl.extract_info(url, False)
    duration = round(info["duration"] / 60)

    if duration > DURATION_LIMIT:
        raise DurationLimitError(
            f"❌ Durasi video lebih lama dari {DURATION_LIMIT} minute(s) tidak diperbolehkan, durasi video yang disediakan adalah {duration} minute(s)"
        )
    try:
        ydl.download([url])
    except:
        raise DurationLimitError(
            f"❌ Durasi video lebih lama dari {DURATION_LIMIT} minute(s) tidak diperbolehkan, durasi video yang disediakan adalah {duration} minute(s)"
        )
    return path.join("downloads", f"{info['id']}.{info['ext']}")
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"**{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.º 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"**@Z44Z4\nتخزين هذه الاغنيه كبير جدا🔻\n يجب ان تكون الاغنيه 65mb او ادنى تخزينا ♻️")
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"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.º 11
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.º 12
0
async def play(client: Client, message_: Message):
    audio = (message_.reply_to_message.audio or message_.reply_to_message.voice
             ) if message_.reply_to_message else None
    chat_id = message_.chat.id
    res = await message_.reply_text("🔄 Processing...")

    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 = audio.file_id + audio.file_name.split(".")[-1]
        file_path = await convert(await
                                  message_.reply_to_message.download(file_name)
                                  )
    else:
        messages = [message_]
        text = ""
        offset = None
        length = None

        if message_.reply_to_message:
            messages.append(message_.reply_to_message)

        for message in messages:
            if offset:
                break

            if message.entities:
                for entity in message.entities:
                    if entity.type == "url":
                        text = message.text or message.caption
                        offset, length = entity.offset, entity.length
                        break

        if offset == None:
            await res.edit_text("❕ You did not give me anything to play.")
            return

        url = text[offset:offset + length]

        file_path = await convert(download(url))

    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(f"#️⃣ Queued at position {position}.")
    else:
        await res.edit_text("▶️ Playing...")
        res.delete
        m = await client.send_photo(
            chat_id=message_.chat.id,
            photo="https://telegra.ph/file/fe07b15733ed56f103cb4.jpg.",
            caption=f"Playing Your song Via Devil music bot..",
            reply_markup=InlineKeyboardMarkup(
                [[InlineKeyboardButton("Skip", callback_data="skip")]]),
            parse_mode="markdown",
        )
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path, 48000,
                                          tgcalls.pytgcalls.get_cache_peer())
Exemplo n.º 13
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.º 14
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.º 15
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.º 16
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.º 17
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.º 18
0
async def play(client: Client, 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.º 19
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.º 20
0
async def play(client: Client, message_: Message):
    audio = (message_.reply_to_message.audio or message_.reply_to_message.voice
             ) if message_.reply_to_message else None

    res = await message_.reply_text("**MʋsɩcRoɓo𝓽:** 🔄 Pʀocɘssɩŋʛ...")

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"**MʋsɩcRoɓo𝓽:** Vɩɗɘos ɭoŋʛɘʀ tʜʌŋ {DURATION_LIMIT} ɱɩŋʋtɘ(s) ʌʀɘŋ't ʌɭɭowɘɗ, tʜɘ pʀovɩɗɘɗ vɩɗɘo ɩs {audio.duration / 60} ɱɩŋʋtɘ(s)"
            )

        file_name = audio.file_id + audio.file_name.split(".")[-1]
        file_path = await convert(await
                                  message_.reply_to_message.download(file_name)
                                  )
    else:
        messages = [message_]
        text = ""
        offset = None
        length = None

        if message_.reply_to_message:
            messages.append(message_.reply_to_message)

        for message in messages:
            if offset:
                break

            if message.entities:
                for entity in message.entities:
                    if entity.type == "url":
                        text = message.text or message.caption
                        offset, length = entity.offset, entity.length
                        break

        if offset == None:
            await res.edit_text(
                "**MʋsɩcRoɓo𝓽:**❕ Yoʋ ɗɩɗ ŋot ʛɩvɘ ɱɘ ʌŋƴtʜɩŋʛ to pɭʌƴ.")
            return

        url = text[offset:offset + length]

        file_path = await convert(download(url))

    try:
        is_playing = tgcalls.pytgcalls.is_playing(message_.chat.id)

    except:
        is_playing = False

    if is_playing:
        position = await sira.add(message_.chat.id, file_path)
        await res.edit_text(
            f"**MʋsɩcRoɓo𝓽:** #️⃣ Qʋɘʋɘɗ ʌt posɩtɩoŋ {position}.")

    else:
        await res.edit_text("**MʋsɩcRoɓo𝓽:** ▶️ Pɭʌƴɩŋʛ...")
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path, 48000)
Exemplo n.º 21
0
async def play(client: Client, message_: Message):
    audio = (message_.reply_to_message.audio or message_.reply_to_message.voice
             ) if message_.reply_to_message else None
    chat_id = message_.chat.id
    res = await message_.reply_text("⎳𝙀𝙇𝙄𝙕𝘼⏤͟͟͞͞★ʳᶱᵇ⁰ᶤ PROCESSING")

    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 = audio.file_id + audio.file_name.split(".")[-1]
        file_path = await convert(await
                                  message_.reply_to_message.download(file_name)
                                  )
    else:
        messages = [message_]
        text = ""
        offset = None
        length = None

        if message_.reply_to_message:
            messages.append(message_.reply_to_message)

        for message in messages:
            if offset:
                break

            if message.entities:
                for entity in message.entities:
                    if entity.type == "url":
                        text = message.text or message.caption
                        offset, length = entity.offset, entity.length
                        break

        if offset == None:
            await res.edit_text(
                " GIVE ME A YT LINK TO PLAY [☺️](https://telegra.ph/file/9ae661b212ecce3ecf1a1.jpg)"
            )
            return

        url = text[offset:offset + length]

        file_path = await convert(download(url))

    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(f"qued at {position}.")
    else:
        await res.edit_text("⎳𝙀𝙇𝙄𝙕𝘼⏤͟͟͞͞★ʳᶱᵇ⁰ᶤ playing on voice chat")
        res.delete
        m = await client.send_photo(
            chat_id=message_.chat.id,
            photo="https://telegra.ph/file/9ae661b212ecce3ecf1a1.jpg",
            caption=f"PLAYING YOUR SONGS ON VOICE CHAT VIA ⎳𝙀𝙇𝙄𝙕𝘼⏤͟͟͞͞★ʳᶱᵇ⁰ᶤ",
        )
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path, 48000,
                                          tgcalls.pytgcalls.get_cache_peer())
Exemplo n.º 22
0
async def play(client: Client, message_: Message):
    audio = (message_.reply_to_message.audio or message_.reply_to_message.voice
             ) if message_.reply_to_message else None
    chat_id = message_.chat.id
    res = await message_.reply_text("AVENGERS MUSIC BOT=🔄 Processing...")

    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 = audio.file_id + audio.file_name.split(".")[-1]
        file_path = await convert(await
                                  message_.reply_to_message.download(file_name)
                                  )
    else:
        messages = [message_]
        text = ""
        offset = None
        length = None

        if message_.reply_to_message:
            messages.append(message_.reply_to_message)

        for message in messages:
            if offset:
                break

            if message.entities:
                for entity in message.entities:
                    if entity.type == "url":
                        text = message.text or message.caption
                        offset, length = entity.offset, entity.length
                        break

        if offset == None:
            await res.edit_text("❕ You did not give me anything to play.")
            return

        url = text[offset:offset + length]

        file_path = await convert(download(url))

    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(
            f"AVENGERS MUSIC BOT=#️⃣ Queued at position {position}.")
    else:
        await res.edit_text("AVENGERS MUSIC BOT=▶️ Playing...")
        res.delete
        m = await client.send_photo(
            chat_id=message_.chat.id,
            photo="https://telegra.ph/file/1fe9a783253e7aefc73ce.jpg",
            caption=
            f"Playing Your song Via  [AVENGERS MUSIC BOT](https://t.me/avengers_help).",
        )
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path)
Exemplo n.º 23
0
async def play(client: Client, message_: Message):
    audio = (message_.reply_to_message.audio or message_.reply_to_message.voice
             ) if message_.reply_to_message else None

    res = await message_.reply_text("🔄 Proses...")

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"Musik lebih dari {DURATION_LIMIT} minute(s) tidak dapat dimainkan, Musik ini berdurasi {audio.duration / 60} minute(s)"
            )

        file_name = audio.file_id + audio.file_name.split(".")[-1]
        file_path = await convert(await
                                  message_.reply_to_message.download(file_name)
                                  )
    else:
        messages = [message_]
        text = ""
        offset = None
        length = None

        if message_.reply_to_message:
            messages.append(message_.reply_to_message)

        for message in messages:
            if offset:
                break

            if message.entities:
                for entity in message.entities:
                    if entity.type == "url":
                        text = message.text or message.caption
                        offset, length = entity.offset, entity.length
                        break

        if offset == None:
            await res.edit_text(
                "Lagu apa yang ingin anda mainkan? coba reply /play ke link lagu yang ingin dimainkan."
            )
            return

        url = text[offset:offset + length]

        file_path = await convert(download(url))

    try:
        is_playing = tgcalls.pytgcalls.is_playing(message_.chat.id)
    except:
        is_playing = False

    if is_playing:
        position = await sira.add(message_.chat.id, file_path)
        await res.edit_text(
            f"#️⃣ Lagu dimasukkan kedalam antrian nomor {position}.")
    else:
        await res.edit_text("▶️ Memainkan lagu...")
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path, 48000)
Exemplo n.º 24
0
async def play(client: Client, message_: Message):
    audio = (message_.reply_to_message.audio or message_.reply_to_message.voice
             ) if message_.reply_to_message else None
    chat_id = message_.chat.id
    res = await message_.reply_text("Wyline=🔄 Işleme Alındı...")

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"Daha uzun videolar {DURATION_LIMIT} minute(s) izin verilmezse, sağlanan video {audio.duration / 60} minute(s)"
            )

        file_name = audio.file_id + audio.file_name.split(".")[-1]
        file_path = await convert(await
                                  message_.reply_to_message.download(file_name)
                                  )
    else:
        messages = [message_]
        text = ""
        offset = None
        length = None

        if message_.reply_to_message:
            messages.append(message_.reply_to_message)

        for message in messages:
            if offset:
                break

            if message.entities:
                for entity in message.entities:
                    if entity.type == "url":
                        text = message.text or message.caption
                        offset, length = entity.offset, entity.length
                        break

        if offset == None:
            await res.edit_text("❕ Bana çalacak bir şey vermedin..")
            return

        url = text[offset:offset + length]

        file_path = await convert(download(url))

    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(f"〰️Wyline〰️=#️⃣ Konumda sıraya alındı {position}."
                            )
    else:
        await res.edit_text("Wyline=▶️ Çalınıyor...")
        res.delete
        m = await client.send_photo(
            chat_id=message_.chat.id,
            photo="https://telegra.ph/Wyline-04-05",
            caption=f"Çalınıyor [Wyline-İnline](https://t.me/WylineVoiceHelp).",
        )
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path)
Exemplo n.º 25
0
async def play(client: Client, message_: Message):
    audio = (message_.reply_to_message.audio or message_.reply_to_message.voice
             ) if message_.reply_to_message else None

    res = await message_.reply_text("**քʀɨռƈɛֆֆ:** 🔄 Processing...")

    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 = audio.file_id + audio.file_name.split(".")[-1]
        file_path = await convert(await
                                  message_.reply_to_message.download(file_name)
                                  )
    else:
        messages = [message_]
        text = ""
        offset = None
        length = None

        if message_.reply_to_message:
            messages.append(message_.reply_to_message)

        for message in messages:
            if offset:
                break

            if message.entities:
                for entity in message.entities:
                    if entity.type == "url":
                        text = message.text or message.caption
                        offset, length = entity.offset, entity.length
                        break

        if offset == None:
            await res.edit_text(
                "**քʀɨռƈɛֆֆ:**❕ You did not give me anything to play.")
            return

        url = text[offset:offset + length]

        file_path = await convert(download(url))

    try:
        is_playing = tgcalls.pytgcalls.is_playing(message_.chat.id)
    except:
        is_playing = False

    if is_playing:
        position = await sira.add(message_.chat.id, file_path)
        await res.edit_text(f"**քʀɨռƈɛֆֆ:** #️⃣ Queued at position {position}."
                            )
    else:
        await res.edit_text("**քʀɨռƈɛֆֆ:** ▶️ Playing...")
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path, 48000)
Exemplo n.º 26
0
def download(song):
    duration = round(song["duration"] / 60)

    if duration > DURATION_LIMIT:
        raise DurationLimitError(
            f"Videos longer than {DURATION_LIMIT} minute(s) aren't allowed, the provided video is {duration} minute(s)"
        )
    ydl.download([song['webpage_url']])
    return path.join("downloads", f"{song['id']}.{song['ext']}")
Exemplo n.º 27
0
async def play(client: Client, message_: Message):
    audio = (message_.reply_to_message.audio or message_.reply_to_message.voice) if message_.reply_to_message else None
    chat_id=message_.chat.id
    res = await message_.reply_text("✯𝗗𝗘𝗡𝗩𝗜𝗟✯=🔄 Processing... Song")

    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 = audio.file_id + audio.file_name.split(".")[-1]
        file_path = await convert(await message_.reply_to_message.download(file_name))
    else:
        messages = [message_]
        text = ""
        offset = None
        length = None

        if message_.reply_to_message:
            messages.append(message_.reply_to_message)

        for message in messages:
            if offset:
                break

            if message.entities:
                for entity in message.entities:
                    if entity.type == "url":
                        text = message.text or message.caption
                        offset, length = entity.offset, entity.length
                        break

        if offset == None:
            await res.edit_text("❕ You did not give me anything to play.")
            return

        url = text[offset:offset+length]

        file_path =await convert(download(url))

    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(f"✯𝗗𝗘𝗡𝗩𝗜𝗟✯=#️⃣ Queued at position {position}.")
    else:
        await res.edit_text("✯𝗗𝗘𝗡𝗩𝗜𝗟✯=▶️ Playing... Song")
        res.delete
        m = await client.send_photo(
        chat_id=message_.chat.id,
        photo="Others/thumbnail2.png",
        reply_markup=InlineKeyboardMarkup(
            [[InlineKeyboardButton("Support⚡️", url="https://t.me/MusicBotEnjoy_group")]]
        ),
        caption=f"Playing Your song Via  [✯𝗗𝗘𝗡𝗩𝗜𝗟✯](https://t.me/MusicBotEnjoy_group).",
         ) 
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path)
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

    res = await message.reply_text(f"**{Bn} :** 🔄 Processing...")

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

        file_name = audio.file_unique_id + "." + (
            audio.file_name.split(".")[-1] if not isinstance(audio, Voice) else "ogg"
        )
        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
        )
    else:
        messages = [message]
        text = ""
        offset = None
        length = None

        if message.reply_to_message:
            messages.append(message.reply_to_message)

        for _message in messages:
            if offset:
                break

            if _message.entities:
                for entity in _message.entities:
                    if entity.type == "url":
                        text = _message.text or _message.caption
                        offset, length = entity.offset, entity.length
                        break

        if offset in (None,):
            await res.edit_text(f"**{Bn} :**❕ WOI BANGKE LINK NYA MANA, LINK WOI LINK , BUKAN LINK BOKEP.")
            return

        url = text[offset:offset + length]

        file_path = await converter.convert(youtube.download(url))

    if message.chat.id in callsmusic.pytgcalls.active_calls:
        position = queues.add(message.chat.id, file_path)
        await res.edit_text(f"**{Bn} :** #️⃣ Queued at position {position}.")
    else:
        await res.edit_text(f"**{Bn} :** ▶️ ANJAI GELENG-GELENG LAGI KITA.....")
                            
                            
                            
                          ...")
        callsmusic.pytgcalls.join_group_call(message.chat.id, file_path, 48000, callsmusic.pytgcalls.get_cache_peer())
Exemplo n.º 29
0
def download(url: str) -> str:
    info = ydl.extract_info(url, False)
    duration = round(info["duration"] / 60)

    if duration > DURATION_LIMIT:
        raise DurationLimitError(
            f"**Hêllẞø†:** Videos longer than {DURATION_LIMIT} minute(s) aren't allowed, the provided video is {duration} minute(s)"
        )

    ydl.download([url])
    return f"downloads/{info['id']}.{info['ext']}"
Exemplo n.º 30
0
def download(url: str) -> str:
    info = ydl.extract_info(url, False)
    duration = round(info["duration"] / 60)

    if duration > DURATION_LIMIT:
        raise DurationLimitError(
            f"✯𝗞𝗵𝗮𝗻 𝗠𝘂𝘀𝗶𝗰 𝗕𝗼𝘁✯= {DURATION_LIMIT} dəqiqədən böyük fayllara icazə verilmir, seçdiyiniz musiqi faylı {duration} dəqiqədir"
        )

    ydl.download([url])
    return f"downloads/{info['id']}.{info['ext']}"