示例#1
0
async def deezer(client: Client, message_: Message):
    requested_by = message_.from_user.first_name
    text = message_.text.split(" ", 1)
    queryy = text[1]
    res = await message_.reply_text(f"Searching 🔍🔎🔍🔎 for `{queryy}` on deezer")
    try:
        arq = ARQ("https://thearq.tech")
        r = await arq.deezer(query=queryy, limit=1)
        title = r[0]["title"]
        duration = int(r[0]["duration"])
        thumbnail = r[0]["thumbnail"]
        artist = r[0]["artist"]
        url = r[0]["url"]
    except:
        await res.edit(
            "Found Literally Nothing, You Should Work On Your English!"
        )
        is_playing = False
        return
    file_path= await convert(wget.download(url))
    await res.edit("Generating Thumbnail")
    await generate_cover_square(requested_by, title, artist, duration, thumbnail)
    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        await res.edit("adding in queue")
        position = 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 , tgcalls.pytgcalls.get_cache_peer())
    await res.delete()
    m = await client.send_photo(
        chat_id=message_.chat.id,
        photo="final.png",
        caption=f"Playing [{title}]({url}) Via Deezer."
    ) 
    os.remove("final.png")
示例#2
0
async def deezer(client: Client, message_: Message):
    global que
    lel = await message_.reply("**bentar ya sayang** 🥵")
    administrators = await get_administrators(message_.chat)
    chid = message_.chat.id
    try:
        user = await USER.get_me()
    except:
        user.first_name = "MusikVCG"
    usar = user
    wew = usar.id
    try:
        #chatdetails = await USER.get_chat(chid)
        lmoa = await client.get_chat_member(chid, wew)
    except:
        for administrator in administrators:
            if administrator == message_.from_user.id:
                try:
                    invitelink = await client.export_chat_invite_link(chid)
                except:
                    await lel.edit(
                        "<b>Tambahkan saya sebagai admin grup Anda terlebih dahulu</b>",
                    )
                    return

                try:
                    await USER.join_chat(invitelink)
                    await USER.send_message(
                        message_.chat.id,
                        "Halo Saya Assistant Bot , Saya akan memainkan lagu yang Anda minta 🥵"
                    )
                    await lel.edit(
                        "<b>Helper userbot bergabung dengan obrolan Anda</b>",
                    )

                except UserAlreadyParticipant:
                    pass
                except Exception as e:
                    #print(e)
                    await lel.edit(
                        f"<b>🔴 Flood Wait Error 🔴 \nAssistant Bot tidak dapat bergabung dengan grup Anda karena banyaknya permintaan bergabung untuk userbot! Pastikan pengguna tidak dibanned dalam grup."
                        "\n\nAtau tambahkan secara manual Assistant Bot ke Grup Anda dan coba lagi</b>",
                    )
                    pass
    try:
        chatdetails = await USER.get_chat(chid)
        #lmoa = await client.get_chat_member(chid,wew)
    except:
        await lel.edit(
            f"<i> Assistant Bot tidak ada dalam grup ini, Minta admin untuk tambahkan Assistant Bot secara manual</i>"
        )
        return
    requested_by = message_.from_user.first_name

    text = message_.text.split(" ", 1)
    queryy = text[1]
    res = lel
    await res.edit(f"Mencari.... `{queryy}` dari deezer")
    try:
        arq = ARQ("https://thearq.tech")
        r = await arq.deezer(query=queryy, limit=1)
        title = r[0]["title"]
        duration = int(r[0]["duration"])
        thumbnail = r[0]["thumbnail"]
        artist = r[0]["artist"]
        url = r[0]["url"]
    except:
        await res.edit("Tidak ditemukan lagu apa pun!")
        is_playing = False
        return
    keyboard = InlineKeyboardMarkup([[
        InlineKeyboardButton('Playlist', callback_data='playlist'),
        InlineKeyboardButton("Panduan",
                             url="https://telegra.ph/Musik-Vcg-Userbot-05-05")
    ], [InlineKeyboardButton("Owner Musik VCG", url="https://t.me/ccwoyx")
        ], [InlineKeyboardButton(text="❌ Close", callback_data='cls')]])
    file_path = await converter.convert(wget.download(url))
    await res.edit("Generating Thumbnail")
    await generate_cover(requested_by, title, artist, duration, thumbnail)
    if message_.chat.id in callsmusic.pytgcalls.active_calls:
        await res.edit("adding in queue")
        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 res.edit_text(
            f"📌 **Lagu yang Anda minta dalam antrian di posisi** {position}!")
    else:
        await res.edit_text("Playing.....")
        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 res.delete()

    m = await client.send_photo(
        chat_id=message_.chat.id,
        reply_markup=keyboard,
        photo="final.png",
        caption=f"🔊 **Sedang memutar lagu** [{title}]({url}) via Deezer")
    os.remove("final.png")
示例#3
0
    InlineKeyboardButton,
    InlineQueryResultArticle,
    InlineQueryResultPhoto,
    InputTextMessageContent,
)
from Python_ARQ import ARQ
from search_engine_parser import GoogleSearch

from RaVaN import BOT_USERNAME, OWNER_ID
from RaVaN.function.pluginhelpers import convert_seconds_to_minutes as time_convert
from RaVaN.function.pluginhelpers import fetch
from RaVaN.services.pyrogram import pbot

SUDOERS = OWNER_ID
ARQ_API = "http://35.240.133.234:8000"
arq = ARQ(ARQ_API)

app = pbot
import socket


async def _netcat(host, port, content):
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect((host, int(port)))
    s.sendall(content.encode())
    s.shutdown(socket.SHUT_WR)
    while True:
        data = s.recv(4096).decode("utf-8").strip("\n\x00")
        if not data:
            break
        return data
示例#4
0
async def deezer(client: Client, message_: Message):
    global que
    lel = await message_.reply("🔄 **Processing**")
    administrators = await get_administrators(message_.chat)
    chid = message_.chat.id
    try:
        user = await USER.get_me()
    except:
        user.first_name =  "musicvcassistant10"
    usar = user
    wew = usar.id
    try:
        #chatdetails = await USER.get_chat(chid)
        lmoa = await client.get_chat_member(chid,wew)
    except:
           for administrator in administrators:
                      if administrator == message_.from_user.id:  
                          try:
                              invitelink = await client.export_chat_invite_link(chid)
                          except:
                              await lel.edit(
                                  "<b>Add me as admin of your group first</b>",
                              )
                              return

                          try:
                              await USER.join_chat(invitelink)
                              await USER.send_message(message_.chat.id,"I joined this group for playing music in VC")
                              await lel.edit(
                                  "<b>musicvcassistant10 joined your chat</b>",
                              )

                          except UserAlreadyParticipant:
                              pass
                          except Exception as e:
                              #print(e)
                              await lel.edit(
                                  f"<b>🔴 Flood Wait Error 🔴 \nUser {user.first_name} couldn't join your group due to heavy requests for userbot! Make sure @musicvcassistant10 is not banned in group."
                                  "\n\nOr manually add @musicvcassistant10 to your Group and try again</b>",
                              )
                              pass
    try:
        chatdetails = await USER.get_chat(chid)
        #lmoa = await client.get_chat_member(chid,wew)
    except:
        await lel.edit(
            f"<i> {user.first_name} Userbot not in this chat, Ask admin to send /play command for first time or add {user.first_name} manually</i>"
        )
        return                            
    requested_by = message_.from_user.first_name   

    text = message_.text.split(" ", 1)
    queryy = text[1]
    res = lel
    await res.edit(f"Searching 👀👀👀 for `{queryy}` on deezer")
    try:
        arq = ARQ("https://thearq.tech")
        r = await arq.deezer(query=queryy, limit=1)
        title = r[0]["title"]
        duration = int(r[0]["duration"])
        thumbnail = r[0]["thumbnail"]
        artist = r[0]["artist"]
        url = r[0]["url"]
    except:
        await res.edit(
            "Found Literally Nothing, You Should Work On Your English!"
        )
        is_playing = False
        return
    keyboard = InlineKeyboardMarkup(
         [   
             [
                 InlineKeyboardButton('📖 Playlist', callback_data='playlist'),
                 InlineKeyboardButton('Menu ⏯ ', callback_data='menu')     
             ],                     
             [
                 InlineKeyboardButton(
                     text="Listen On Deezer 🎬",
                     url=f"{url}")

             ],
             [       
                 InlineKeyboardButton(
                     text="❌ Close",
                     callback_data='cls')

            ]                      
         ]
     )
    file_path= await converter.convert(wget.download(url))
    await res.edit("Generating Thumbnail")
    await generate_cover(requested_by, title, artist, duration, thumbnail)
    if message_.chat.id in callsmusic.pytgcalls.active_calls:
        await res.edit("adding in queue")
        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 res.edit_text(f"#️⃣ Queued at position {position}")
    else:
        await res.edit_text("▶️ Playing.....")
        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 res.delete()

    m = await client.send_photo(
        chat_id=message_.chat.id,
        reply_markup=keyboard,
        photo="final.png",
        caption=f"Playing [{title}]({url}) Via Deezer"
    ) 
    os.remove("final.png")
示例#5
0
if is_config:
    from config import *
else:
    from sample_config import *

if HEROKU:
    if is_config:
        from config import SESSION_STRING
    elif not is_config:
        from sample_config import SESSION_STRING

app = Client(SESSION_STRING if HEROKU else "tgvc",
             api_id=API_ID,
             api_hash=API_HASH)
session = ClientSession()
arq = ARQ(ARQ_API, ARQ_API_KEY, session)
themes = ["darkred", "lightred", "green", "purple", "skyblue", "dark", "black"]


def get_theme(chat_id) -> str:
    theme = "purple"
    if chat_id not in db:
        db[chat_id] = {}
    if "theme" not in db[chat_id]:
        db[chat_id]["theme"] = theme
    theme = db[chat_id]["theme"]
    return theme


def change_theme(name: str, chat_id):
    if chat_id not in db:
示例#6
0
async def deezer(client: Client, message_: Message):
    global que
    lel = await message_.reply("🔄 **Sedang Memproses**")
    administrators = await get_administrators(message_.chat)
    chid = message_.chat.id
    usar = await USER.get_me()
    wew = usar.id
    for administrator in administrators:
        if administrator == message_.from_user.id:
            try:
                invitelink = await client.export_chat_invite_link(chid)
            except:
                await lel.edit(
                    "<b>Tambahkan saya sebagai admin grup terlebih dahulu</b>",
                )
                return

            try:
                await USER.join_chat(invitelink)
                await lel.edit("<b>helper userbot joined your chat</b>", )

            except UserAlreadyParticipant:
                pass
            except Exception as e:
                #print(e)
                #await lel.edit(
                #    f"<b>User {user.first_name} couldn't join your group! Make sure user is not banned in group."
                #    "\n\nOr manually add @DaisyXmusic to your Group and try again</b>",
                #)
                pass
    try:
        chatdetails = await USER.get_chat(chid)
        #lmoa = await client.get_chat_member(chid,wew)
    except:
        await lel.edit(
            "<i> @helper Userbot not in this chat, Ask admin to send /play command for first time or add assistant manually</i>"
        )
        return
    requested_by = message_.from_user.first_name
    try:
        #chatdetails = await USER.get_chat(chid)
        lmoa = await client.get_chat_member(chid, wew)
    except:
        await lel.reply(
            "<i>Looks like helper Userbot not in this chat, Ask admin to send /play command for first time or add assistant manually</i>"
        )
        pass

    text = message_.text.split(" ", 1)
    queryy = text[1]
    res = lel
    await res.edit(f"Searching 👀👀👀 for `{queryy}` on deezer")
    try:
        arq = ARQ("https://thearq.tech")
        r = await arq.deezer(query=queryy, limit=1)
        title = r[0]["title"]
        duration = int(r[0]["duration"])
        thumbnail = r[0]["thumbnail"]
        artist = r[0]["artist"]
        url = r[0]["url"]
    except:
        await res.edit(
            "Found Literally Nothing, You Should Work On Your English!")
        is_playing = False
        return
    keyboard = InlineKeyboardMarkup(
        [[
            InlineKeyboardButton('📖 Playlist', callback_data='playlist'),
            InlineKeyboardButton('Menu ⏯ ', callback_data='menu')
        ],
         [
             InlineKeyboardButton("Ch Support",
                                  url="https://t.me/hanyabotferi"),
             InlineKeyboardButton("Owner Musik", url="https:/t.me/xflicks")
         ], [InlineKeyboardButton(text="❌ Close", callback_data='cls')]])
    file_path = await converter.convert(wget.download(url))
    await res.edit("Generating Thumbnail")
    await generate_cover(requested_by, title, artist, duration, thumbnail)
    if message_.chat.id in callsmusic.pytgcalls.active_calls:
        await res.edit("adding in queue")
        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 res.edit_text(f"Playing [{title}]({url}) Via Deezer")
    else:
        await res.edit_text("▶️ Memutar Lagu.....")
        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 res.delete()

    m = await client.send_photo(
        chat_id=message_.chat.id,
        reply_markup=keyboard,
        photo="final.png",
        caption=f"#️⃣ Mengantri di posisi {position}.).")
    os.remove("final.png")
示例#7
0
if not HEROKU:
    print("[INFO]: LOADING USERBOT CLIENT")
    app2 = Client("userbot",
                  phone_number=PHONE_NUMBER,
                  api_id=API_ID,
                  api_hash=API_HASH)
else:
    print("[INFO]: LOADING USERBOT CLIENT")
    app2 = Client(SESSION_STRING, api_id=API_ID, api_hash=API_HASH)

# Bot client
print("[INFO]: LOADING BOT CLIENT")
app = Client("wbb", bot_token=BOT_TOKEN, api_id=API_ID, api_hash=API_HASH)
# ARQ client
print("[INFO]: LOADING ARQ")
arq = ARQ(ARQ_API_URL, ARQ_API_KEY)
# Telegraph client
print("[INFO]: LOADING TELEGRAPH")
telegraph = Telegraph()
telegraph.create_account(short_name="wbb")

BOT_ID = 0
BOT_NAME = ""
BOT_USERNAME = ""
BOT_MENTION = ""
BOT_DC_ID = 0
USERBOT_ID = 0
USERBOT_NAME = ""
USERBOT_USERNAME = ""
USERBOT_DC_ID = 0
USERBOT_MENTION = ""
示例#8
0
from DaisyXMusic.config import DURATION_LIMIT
from DaisyXMusic.config import UPDATES_CHANNEL as updateschannel
from DaisyXMusic.config import que
from DaisyXMusic.function.admins import admins as a
from DaisyXMusic.helpers.admins import get_administrators
from DaisyXMusic.helpers.channelmusic import get_chat_id
from DaisyXMusic.helpers.decorators import authorized_users_only
from DaisyXMusic.helpers.filters import command, other_filters
from DaisyXMusic.helpers.gets import get_file_name
from DaisyXMusic.services.callsmusic import callsmusic, queues
from DaisyXMusic.services.callsmusic.callsmusic import client as USER
from DaisyXMusic.services.converter.converter import convert
from DaisyXMusic.services.downloaders import youtube

chat_id = None
arq = ARQ("https://thearq.tech", ARQ_API_KEY)


def cb_admin_check(func: Callable) -> Callable:
    async def decorator(client, cb):
        admemes = a.get(cb.message.chat.id)
        if cb.from_user.id in admemes:
            return await func(client, cb)
        else:
            await cb.answer("İzin yok", show_alert=True)
            return

    return decorator


def transcode(filename):
示例#9
0
async def deezer(client: Client, message_: Message):
    global que
    lel = await message_.reply("🔄 **Sedang Proses**")
    administrators = await get_administrators(message_.chat)
    chid = message_.chat.id
    try:
        user = await USER.get_me()
    except:
        user.first_name = "DaisyMusic"
    usar = user
    wew = usar.id
    try:
        #chatdetails = await USER.get_chat(chid)
        lmoa = await client.get_chat_member(chid, wew)
    except:
        for administrator in administrators:
            if administrator == message_.from_user.id:
                try:
                    invitelink = await client.export_chat_invite_link(chid)
                except:
                    await lel.edit(
                        "<b>Jadikan Aku Admin Terlebih Dahulu</b>", )
                    return

                try:
                    await USER.join_chat(invitelink)
                    await USER.send_message(
                        message_.chat.id,
                        "Aku Official Assistance Dari Tokai Music Bot")
                    await lel.edit(
                        "<b>Asisten Bot Berhasil Join Ke Grup</b>", )

                except UserAlreadyParticipant:
                    pass
                except Exception as e:
                    #print(e)
                    await lel.edit(
                        f"<b>🔴 Flood Wait Error 🔴 \nUser {user.first_name} Tidak Dapat Memasuki Grup Karena Masalah Flood! Pastikan User Tidak Dibanned Digrup."
                        "\n\nAtau Tambahkan @TokaiMusicAssistance Secara Manual Dan Coba Lagi</b>",
                    )
                    pass
    try:
        chatdetails = await USER.get_chat(chid)
        #lmoa = await client.get_chat_member(chid,wew)
    except:
        await lel.edit(
            f"<i> {user.first_name} Userbot Tidak Ada Di Grup, Minta Admin Untuk /play Command Untuk Pertama Kalinya Atau Menambahkan {user.first_name} Secara Manual</i>"
        )
        return
    requested_by = message_.from_user.first_name

    text = message_.text.split(" ", 1)
    queryy = text[1]
    res = lel
    await res.edit(f"Sedang Mencari `{queryy}` Via Deezer")
    try:
        arq = ARQ("https://thearq.tech")
        r = await arq.deezer(query=queryy, limit=1)
        title = r[0]["title"]
        duration = int(r[0]["duration"])
        thumbnail = r[0]["thumbnail"]
        artist = r[0]["artist"]
        url = r[0]["url"]
    except:
        await res.edit("Tidak Menemukan Apapun, Ketik Dengan Benar!")
        is_playing = False
        return
    keyboard = InlineKeyboardMarkup([[
        InlineKeyboardButton('📖 Playlist', callback_data='playlist'),
        InlineKeyboardButton('Menu ⏯ ', callback_data='menu')
    ], [InlineKeyboardButton(text="Channel", url='https://t.me/TokaiMusik')]])
    file_path = await converter.convert(wget.download(url))
    await res.edit("Generating Thumbnail")
    await generate_cover(requested_by, title, artist, duration, thumbnail)
    if message_.chat.id in callsmusic.pytgcalls.active_calls:
        await res.edit("adding in queue")
        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 res.edit_text(f"Tokai Music #️⃣ Queued Di Posisi {position}")
    else:
        await res.edit_text("Tokai Music ▶️ Memutar.....")
        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 res.delete()

    m = await client.send_photo(chat_id=message_.chat.id,
                                reply_markup=keyboard,
                                photo="final.png",
                                caption=f"Memutar [{title}]({url}) Via Deezer")
    os.remove("final.png")
示例#10
0
async def deezer(client: Client, message_: Message):
    global que
    lel = await message_.reply("🔄 **Işleme**")
    administrators = await get_administrators(message_.chat)
    chid = message_.chat.id
    try:
        user = await USER.get_me()
    except:
        user.first_name =  "TurkishVoicebot"
    usar = user
    wew = usar.id
    try:
        #chatdetails = await USER.get_chat(chid)
        lmoa = await client.get_chat_member(chid,wew)
    except:
           for administrator in administrators:
                      if administrator == message_.from_user.id:  
                          try:
                              invitelink = await client.export_chat_invite_link(chid)
                          except:
                              await lel.edit(
                                  "<b>Önce beni grubunun yöneticisi olarak ekle</b>",
                              )
                              return

                          try:
                              await USER.join_chat(invitelink)
                              await USER.send_message(message_.chat.id,"Bu gruba VC'de müzik çalmak için katıldım.")
                              await lel.edit(
                                  "<b>yardımcı userbot sohbetinize katıldı</b>",
                              )

                          except UserAlreadyParticipant:
                              pass
                          except Exception as e:
                              #print(e)
                              await lel.edit(
                                  f"<b>🔴 Taşan Bekleme Hatası 🔴 \nUser {user.first_name} userbot için yoğun istekler nedeniyle grubunuza katılamadı! Kullanıcının grupta yasaklı olmadığından emin olun."
                                  "\n\nOr Elle ekl @TurkishVoicebot grubunuza ve yeniden deneyin</b>",
                              )
                              pass
    try:
        chatdetails = await USER.get_chat(chid)
        #lmoa = await client.get_chat_member(chid,wew)
    except:
        await lel.edit(
            f"<i> {user.first_name} Userbot bu sohbette yok, Yöneticiden göndermesini iste /play komut ilk kez veya elle ekle {user.first_name} </i>"
        )
        return                            
    requested_by = message_.from_user.first_name   

    text = message_.text.split(" ", 1)
    queryy = text[1]
    res = lel
    await res.edit(f"Araştırıyor 👀👀👀  `{queryy}` deezer üzerinde")
    try:
        arq = ARQ("https://thearq.tech")
        r = await arq.deezer(query=queryy, limit=1)
        title = r[0]["title"]
        duration = int(r[0]["duration"])
        thumbnail = r[0]["thumbnail"]
        artist = r[0]["artist"]
        url = r[0]["url"]
    except:
        await res.edit(
            "Kelimenin Tam Anlamıyla Hiçbir Şey Bulunamadı, Türkçe üzerinde çalışmalısınız!"
        )
        is_playing = False
        return
    keyboard = InlineKeyboardMarkup(
         [   
             [
                 InlineKeyboardButton('📖 Çalma listesi', callback_data='playlist'),
                 InlineKeyboardButton('Menü ⏯ ', callback_data='menu')     
             ],                     
             [
                 InlineKeyboardButton(
                     text="Deezer'da Dinle 🎬",
                     url=f"{url}")

             ],
             [       
                 InlineKeyboardButton(
                     text="❌ kapatmak",
                     callback_data='cls')

            ]                      
         ]
     )
    file_path= await converter.convert(wget.download(url))
    await res.edit("Küçük Resim Oluşturma")
    await generate_cover(requested_by, title, artist, duration, thumbnail)
    if message_.chat.id in callsmusic.pytgcalls.active_calls:
        await res.edit("sıraya ekleme")
        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 res.edit_text("TurkishVoicebot= #️⃣ Konumda sıraya alındı {position}")
    else:
        await res.edit_text("TurkishVoicebot🎧=▶️ Çalıyor.....")
        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 res.delete()

    m = await client.send_photo(
        chat_id=message_.chat.id,
        reply_markup=keyboard,
        photo="final.png",
        caption=f"Çalıyor [{title}]({url}) Deezer"
    ) 
    os.remove("final.png")
示例#11
0
    session_name,
    api_id=API_ID,
    api_hash=API_HASH,
    bot_token=TOKEN,
)
print(
    "[CUTIEPII]: Connecting To Yūki • Data Center • Mumbai • MongoDB Database")
mongodb = MongoClient(MONGO_DB_URL, 27017)[MONGO_DB]
motor = motor_asyncio.AsyncIOMotorClient(MONGO_DB_URL)
db = motor[MONGO_DB]
engine = AIOEngine(motor, MONGO_DB)
print("[INFO]: INITIALZING AIOHTTP SESSION")
aiohttpsession = ClientSession()
# ARQ Client
print("[INFO]: INITIALIZING ARQ CLIENT")
arq = ARQ("https://thearq.tech", "YIECCC-NAJARO-OLLREW-SJSRIP-ARQ",
          aiohttpsession)
print(
    "[CUTIEPII]: Connecting To Yūki • Data Center • Mumbai • PostgreSQL Database"
)
ubot = TelegramClient(StringSession(STRING_SESSION), APP_ID, APP_HASH)
print(
    "[CUTIEPII]: Connecting To Yūki • Cutiepii Userbot (t.me/Awesome_Cutiepii)"
)
timeout = httpx.Timeout(40)
http = httpx.AsyncClient(http2=True, timeout=timeout)


async def get_entity(client, entity):
    entity_client = client
    if not isinstance(entity, Chat):
        try:
示例#12
0
async def deezer(client: Client, message_: Message):
    global que
    lel = await message_.reply("🔄 **Processing Song**")
    administrators = await get_administrators(message_.chat)
    chid = message_.chat.id
    try:
        user = await USER.get_me()
    except:
        user.first_name = "MusicMan"
    usar = user
    wew = usar.id
    try:
        #chatdetails = await USER.get_chat(chid)
        lmoa = await client.get_chat_member(chid, wew)
    except:
        for administrator in administrators:
            if administrator == message_.from_user.id:
                try:
                    invitelink = await client.export_chat_invite_link(chid)
                except:
                    await lel.edit("<b>Add me as your group admin first</b>", )
                    return

                try:
                    await USER.join_chat(invitelink)
                    await USER.send_message(
                        message_.chat.id,
                        "I joined this group to play music on VCG")
                    await lel.edit("<b>Userbot helper joins your chat</b>", )

                except UserAlreadyParticipant:
                    pass
                except Exception as e:
                    #print(e)
                    await lel.edit(
                        f"<b>🔴 Flood Wait Error 🔴 \nAssistant Bot cannot join your group due to the many requests to join userbot! Make sure the user is not banned in the group."
                        "\n\nOr manually add @AMSuserbot to your Groups and try again</b>",
                    )
                    pass
    try:
        chatdetails = await USER.get_chat(chid)
        #lmoa = await client.get_chat_member(chid,wew)
    except:
        await lel.edit(
            f"<i> Assistant Bot is not in this group, Ask admin to add Assistant Bot manually</i>"
        )
        return
    requested_by = message_.from_user.first_name

    text = message_.text.split(" ", 1)
    queryy = text[1]
    res = lel
    await res.edit(f"Looking for `{queryy}` from deezer")
    try:
        arq = ARQ("https://thearq.tech")
        r = await arq.deezer(query=queryy, limit=1)
        title = r[0]["title"]
        duration = int(r[0]["duration"])
        thumbnail = r[0]["thumbnail"]
        artist = r[0]["artist"]
        url = r[0]["url"]
    except:
        await res.edit("Not Found Any Song!")
        is_playing = False
        return
    keyboard = InlineKeyboardMarkup([[
        InlineKeyboardButton('📖 Playlist', callback_data='playlist'),
        InlineKeyboardButton("⛑ Support", url="https://t.me/AMSuserbot")
    ], [InlineKeyboardButton("Owner", url="https://t.me/AMSuserbot")
        ], [InlineKeyboardButton(text="🗑 Close", callback_data='cls')]])
    file_path = await converter.convert(wget.download(url))
    await res.edit("Generating Thumbnail")
    await generate_cover(requested_by, title, artist, duration, thumbnail)
    if message_.chat.id in callsmusic.pytgcalls.active_calls:
        await res.edit("adding in queue")
        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 res.edit_text(
            f"#️⃣ The song you requested is **In Queue** in position {position}"
        )
    else:
        await res.edit_text("Playing.....")
        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 res.delete()

    m = await client.send_photo(
        chat_id=message_.chat.id,
        reply_markup=keyboard,
        photo="final.png",
        caption=f"🎼️ **Now Playing **Song [{title}]({url}) Via Deezer")
    os.remove("final.png")
示例#13
0
# Made By Devanagaraj
# https://github.com/Devanagaraj
# Thanks to ARQ API

import os

from aiohttp import ClientSession
from Python_ARQ import ARQ
from userge import Config, Message, userge
from userge.plugins.misc.download import url_download

ARQ_KEY = os.environ.get("ARQ_KEY", None)

# ARQ API
session = ClientSession()
arq = ARQ("https://thearq.tech", ARQ_KEY, session)
saavn = arq.saavn

LOGGER = userge.getLogger(__name__)


@userge.on_cmd(
    "music",
    about={
        "header": "Search and Download Music",
        "description": "It Searches and Downloads Music from JioSaavn in HQ",
        "examples": "{tr}music name",
    },
)
async def music(message: Message):
    if not ARQ_KEY:
示例#14
0
    InlineQueryResultPhoto,
    InputTextMessageContent,
)
from Python_ARQ import ARQ
from search_engine_parser import GoogleSearch

from DaisyX import BOT_USERNAME, OWNER_ID
from DaisyX.config import get_str_key
from DaisyX.function.pluginhelpers import convert_seconds_to_minutes as time_convert
from DaisyX.function.pluginhelpers import fetch
from DaisyX.services.pyrogram import pbot

ARQ_API = get_str_key("ARQ_API", required=True)
SUDOERS = OWNER_ID
ARQ_API_URL = "https://thearq.tech"
arq = ARQ(ARQ_API_URL, ARQ_API)

app = pbot
import socket


async def _netcat(host, port, content):
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect((host, int(port)))
    s.sendall(content.encode())
    s.shutdown(socket.SHUT_WR)
    while True:
        data = s.recv(4096).decode("utf-8").strip("\n\x00")
        if not data:
            break
        return data
示例#15
0
async def deezer(client: Client, message_: Message):
    global que
    lel = await message_.reply("🔄 **Processing...**\n Mohon Tunggu Sebentar.")
    administrators = await get_administrators(message_.chat)
    chid = message_.chat.id
    try:
        user = await USER.get_me()
    except:
        user.first_name = "MusicVCGRobot"
    usar = user
    wew = usar.id
    try:
        #chatdetails = await USER.get_chat(chid)
        lmoa = await client.get_chat_member(chid, wew)
    except:
        for administrator in administrators:
            if administrator == message_.from_user.id:
                try:
                    invitelink = await client.export_chat_invite_link(chid)
                except:
                    await lel.edit(
                        "<b>Tambahkan Saya Menjadi Admin Terlebih Dahulu.</b>",
                    )
                    return

                try:
                    await USER.join_chat(invitelink)
                    await USER.send_message(
                        message_.chat.id,
                        "Saya Bergabung Dengan Group ini Untuk Memainkan Musik di VCG."
                    )
                    await lel.edit(
                        "<b>Robot Telah Bergabung Kedalam Group.</b>", )

                except UserAlreadyParticipant:
                    pass
                except Exception as e:
                    #print(e)
                    await lel.edit(
                        f"<b>🔴 Flood Wait Error 🔴 \n {user.first_name} Tidak Dapat Bergabung Dengan Grup Anda Karena Banyaknya Permintaan Untuk Assistant Saya. Pastikan @AssistantMusicVCGRobot Tidak Dilarang Didalam Group."
                        "\n\nAtau Tambahkan @AssistantMusicVCGRobot ke Grup Anda Secara Manual dan Coba Lagi.</b>",
                    )
                    pass
    try:
        chatdetails = await USER.get_chat(chid)
        #lmoa = await client.get_chat_member(chid,wew)
    except:
        await lel.edit(
            f"<i> {user.first_name} Sedang Tidak Dalam Obrolan Ini, Minta Kepada Admin Untuk Menekan » /joingroup Untuk Pertama Kalinya atau Tambahkan {user.first_name} Secara Manual.</i>"
        )
        return
    requested_by = message_.from_user.first_name

    text = message_.text.split(" ", 1)
    queryy = text[1]
    res = lel
    await res.edit(f"Mencari Lagu `{queryy}` Di Deezer")
    try:
        arq = ARQ("https://thearq.tech")
        r = await arq.deezer(query=queryy, limit=1)
        title = r[0]["title"]
        duration = int(r[0]["duration"])
        thumbnail = r[0]["thumbnail"]
        artist = r[0]["artist"]
        url = r[0]["url"]
    except:
        await res.edit(
            "Lagu Tidak Dapat Ditemukan, Anda Harus Menggunakan Ejaan Dengan Benar!"
        )
        is_playing = False
        return
    keyboard = InlineKeyboardMarkup([[
        InlineKeyboardButton('📖 Playlist', callback_data='playlist'),
        InlineKeyboardButton('Menu ⏯ ', callback_data='menu')
    ], [InlineKeyboardButton(text="Listen On Deezer 🎬", url=f"{url}")
        ], [InlineKeyboardButton(text="❌ Close", callback_data='cls')]])
    file_path = await converter.convert(wget.download(url))
    await res.edit("Generating Thumbnail")
    await generate_cover(requested_by, title, artist, duration, thumbnail)
    if message_.chat.id in callsmusic.pytgcalls.active_calls:
        await res.edit("adding in queue")
        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 res.edit_text(f"MusicVCGRobot = #️⃣ Antrian Di Posisi {position}"
                            )
    else:
        await res.edit_text("MusicVCGRobot = ▶️ Playing.....")
        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 res.delete()

    m = await client.send_photo(
        chat_id=message_.chat.id,
        reply_markup=keyboard,
        photo="final.png",
        caption=f"Sedang Memutar [{title}]({url}) Via Deezer")
    os.remove("final.png")
示例#16
0
async def deezer(client: Client, message_: Message):
    global que
    lel = await message_.reply("🔄 Processing...")
    administrators = await get_administrators(message_.chat)
    chid = message_.chat.id
    try:
        user = await USER.get_me()
    except:
        user.first_name =  "Irama_Musik"
    usar = user
    wew = usar.id
    try:
        #chatdetails = await USER.get_chat(chid)
        lmoa = await client.get_chat_member(chid,wew)
    except:
           for administrator in administrators:
                      if administrator == message_.from_user.id:  
                          try:
                              invitelink = await client.export_chat_invite_link(chid)
                          except:
                              await lel.edit(
                                  "#Jadikan saya admin terlebih dahulu**",
                              )
                              return

                          try:
                              await USER.join_chat(invitelink)
                              await USER.send_message(message_.chat.id,"**Saya bergabung kesini didedikasi untuk memutar/mendownload lagu dan musik**")
                              await lel.edit(
                                  "**@Irama_Musik bergabung ke grup**",
                              )

                          except UserAlreadyParticipant:
                              pass
                          except Exception as e:
                              #print(e)
                              await lel.edit(
                                  f"**#Maaf @Irama_Musik tidak dapat bergabung, Pastikan dia tidak dibanned**"
                                   "\n\n**Atau add @Irama_Musik secara manual dengan tambahkan anggota!**",
                              )
                              pass
    try:
        chatdetails = await USER.get_chat(chid)
        #lmoa = await client.get_chat_member(chid,wew)
    except:
        await lel.edit(
            f"**#Masukkan @Irama_Musik terlebih dahulu**"
        )
        return                            
    requested_by = message_.from_user.first_name   

    text = message_.text.split(" ", 1)
    queryy = text[1]
    res = lel
    await res.edit(f"Mencari Untuk **{queryy}** Via Deezer")
    try:
        arq = ARQ("https://thearq.tech")
        r = await arq.deezer(query=queryy, limit=1)
        title = r[0]["title"]
        duration = int(r[0]["duration"])
        thumbnail = r[0]["thumbnail"]
        artist = r[0]["artist"]
        url = r[0]["url"]
    except:
        await res.edit(
            "#Tidak Ditemukan Apapun!"
        )
        is_playing = False
        return
    keyboard = InlineKeyboardMarkup(
            [   
                [
                    InlineKeyboardButton(
                        text="ɪɴꜱᴛᴀɢʀᴀᴍ",
                        url=f"https://www.instagram.com/hendraputraaaaaa"),
                    InlineKeyboardButton(
                        text="ɢʀᴏᴜᴘ ᴍᴜꜱɪᴄ",
                        url=f"https://t.me/vcgsupportgroup"),
                
            ]                            
            ]
        )
    file_path= await converter.convert(wget.download(url))
    await res.edit("Generating Thumbnail")
    await generate_cover(requested_by, title, artist, duration, thumbnail)
    if message_.chat.id in callsmusic.pytgcalls.active_calls:
        await res.edit("adding in queue")
        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 res.edit_text(f"**IramaMusik**= #️⃣ Queued at position {position}")
    else:
        await res.edit_text("Playing...")
        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 res.delete()

    m = await client.send_photo(
        chat_id=message_.chat.id,
        reply_markup=keyboard,
        photo="final.png",
        caption=f"🏷 **Judul:** [{title[:60]}]({url})\n⏱ **Durasi:** {duration}\n" \
               + f"💡 **Status:** `Playing`\n🎧 **Permintaan:** {requested_by}"
        ),
    os.remove("final.png")
MOD_NOLOAD = []
bot_start_time = time.time()


if not HEROKU:
    app2 = Client("userbot", phone_number=PHONE_NUMBER, api_id=API_ID, api_hash=API_HASH)
else:
    app2 = Client(SESSION_STRING, api_id=API_ID, api_hash=API_HASH)

# Bot client
app = Client("wbb", bot_token=BOT_TOKEN, api_id=API_ID, api_hash=API_HASH)
# MongoDB client
mongo_client = MongoClient(MONGO_DB_URI)
db = mongo_client.wbb
# ARQ client
arq = ARQ(ARQ_API_BASE_URL)
# Telegram client
telegraph = Telegraph()
telegraph.create_account(short_name="wbb")
session = aiohttp.ClientSession()
# Spamwatch client
spamwatch = spamwatch_.Client(SPAMWATCH_API_KEY)

BOT_ID = 0
BOT_NAME = ""
BOT_USERNAME = ""
BOT_MENTION = ""
BOT_DC_ID = 0
USERBOT_ID = 0
USERBOT_NAME = ""
USERBOT_USERNAME = ""
示例#18
0
    session_name,
    api_id=API_ID,
    api_hash=API_HASH,
    bot_token=TOKEN,
)
print(
    "[CUTIEPII]: Connecting To Yūki • Data Center • Mumbai • MongoDB Database")
mongodb = MongoClient(MONGO_DB_URL, MONGO_PORT)[MONGO_DB]
motor = motor_asyncio.AsyncIOMotorClient(MONGO_DB_URL)
db = motor[MONGO_DB]
engine = AIOEngine(motor, MONGO_DB)
print("[INFO]: INITIALZING AIOHTTP SESSION")
aiohttpsession = ClientSession()
# ARQ Client
print("[INFO]: INITIALIZING ARQ CLIENT")
arq = ARQ(ARQ_API_URL, ARQ_API_KEY, aiohttpsession)
print(
    "[CUTIEPII]: Connecting To Yūki • Data Center • Mumbai • PostgreSQL Database"
)
ubot = TelegramClient(StringSession(STRING_SESSION), APP_ID, APP_HASH)
print(
    "[CUTIEPII]: Connecting To Yūki • Cutiepii Userbot (t.me/Awesome_Cutiepii)"
)
timeout = httpx.Timeout(40, pool=None)
http = httpx.AsyncClient(http2=True, timeout=timeout)


async def get_entity(client, entity):
    entity_client = client
    if not isinstance(entity, Chat):
        try:
示例#19
0
        from sample_config import SESSION_STRING

queue = []  # This is where the whole song queue is stored
playing = False  # Tells if something is playing or not
call = {}

# Pyrogram Client
if not HEROKU:
    app = Client("tgvc", api_id=API_ID, api_hash=API_HASH)
else:
    app = Client(SESSION_STRING, api_id=API_ID, api_hash=API_HASH)

# Pytgcalls Client

# Arq Client
arq = ARQ(ARQ_API, "YCLZTK-LIFRNJ-VZNBYY-ISCQAN-ARQ")


async def delete(message):
    await asyncio.sleep(10)
    await message.delete()


@app.on_message(
    filters.command("start")
    & ~filters.private
    & (filters.user(SUDOERS) | filters.chat(SUDO_CHAT_ID)))
async def start(_, message):
    await message.reply_text(START_TEXT, quote=False)

示例#20
0
from youtube_dl import YoutubeDL
import asyncio
from config import DURATION_LIMIT
from helpers.errors import DurationLimitError
from helpers.filters import command, other_filters
from helpers.decorators import errors, authorized_users_only
from helpers.player import ytplay, play_song
from Python_ARQ import ARQ
import logging

logging.basicConfig(
    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
    level=logging.INFO)

# Arq Client
arq = ARQ("https://thearq.tech")

ydl_opts = {
    "format": "bestaudio/best",
    "geo-bypass": True,
    "nocheckcertificate": True,
    "outtmpl": "%(id)s.%(ext)s",
}

ydl = YoutubeDL(ydl_opts)


@Client.on_message(command("play") & other_filters)
@errors
@authorized_users_only
async def play(client, message: Message):
示例#21
0
from pyrogram.methods.messages.download_media import DEFAULT_DOWNLOAD_DIR
from pyrogram.types import Message
from utils import mp, RADIO
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
from Python_ARQ import ARQ
from youtube_search import YoutubeSearch
from pyrogram import Client
from aiohttp import ClientSession
import re

LOG_GROUP = Config.LOG_GROUP

DURATION_LIMIT = Config.DURATION_LIMIT
ARQ_API = Config.ARQ_API
session = ClientSession()
arq = ARQ("https://thearq.tech", ARQ_API, session)
playlist = Config.playlist

ADMINS = Config.ADMINS
CHAT = Config.CHAT
LOG_GROUP = Config.LOG_GROUP
playlist = Config.playlist


@Client.on_message(filters.command("play") | filters.audio & filters.private)
async def yplay(_, message: Message):
    type = ""
    yturl = ""
    ysearch = ""
    if message.audio:
        type = "audio"
示例#22
0
async def deezer(client: Client, message_: Message):
    global que
    lel = await message_.reply("🔄 **Sedang Memproses Lagu-mu!**")
    administrators = await get_administrators(message_.chat)
    chid = message_.chat.id
    try:
        user = await USER.get_me()
    except:
        user.first_name = "Crystal Music!"
    usar = user
    wew = usar.id
    try:
        #chatdetails = await USER.get_chat(chid)
        lmoa = await client.get_chat_member(chid, wew)
    except:
        for administrator in administrators:
            if administrator == message_.from_user.id:
                try:
                    invitelink = await client.export_chat_invite_link(chid)
                except:
                    await lel.edit(
                        "<b>Tambahkan saya sebagai admin grup Anda terlebih dahulu</b>",
                    )
                    return

                try:
                    await USER.join_chat(invitelink)
                    await USER.send_message(
                        message_.chat.id,
                        "Saya bergabung dengan grup ini untuk memainkan musik di VCG"
                    )
                    await lel.edit(
                        "<b>Assisten bot bergabung dengan obrolan Anda</b>", )

                except UserAlreadyParticipant:
                    pass
                except Exception as e:
                    #print(e)
                    await lel.edit(
                        f"<b>🔴 Flood Wait Error \nAssistant Bot tidak dapat bergabung dengan grup Anda karena banyaknya permintaan bergabung untuk bot! Pastikan pengguna tidak dibanned/blokir dalam grup."
                        "\n\nAtau tambahkan secara manual @assistencrystal ke Grup Anda dan coba lagi</b>",
                    )
                    pass
    try:
        chatdetails = await USER.get_chat(chid)
        #lmoa = await client.get_chat_member(chid,wew)
    except:
        await lel.edit(
            f"<i> Assistant Bot tidak ada dalam grup ini, Minta admin untuk tambahkan Assistant Bot secara manual</i>"
        )
        return
    requested_by = message_.from_user.first_name

    text = message_.text.split(" ", 1)
    queryy = text[1]
    res = lel
    await res.edit(f"Sedang Mencari Lagu-mu!..... `{queryy}` dari deezer")
    try:
        arq = ARQ("https://thearq.tech")
        r = await arq.deezer(query=queryy, limit=1)
        title = r[0]["title"]
        duration = int(r[0]["duration"])
        thumbnail = r[0]["thumbnail"]
        artist = r[0]["artist"]
        url = r[0]["url"]
    except:
        await res.edit("Tidak Ditemukan Lagu Apa Pun!")
        is_playing = False
        return
    keyboard = InlineKeyboardMarkup([[
        InlineKeyboardButton('🎶 Daftar Putar', callback_data='playlist'),
        InlineKeyboardButton("Menu ⏯", callback_data='menu')
    ], [
        InlineKeyboardButton("✨ Owner Aku!", url="https://t.me/afterdaytoxic")
    ], [InlineKeyboardButton(text="❌ Tutup!", callback_data='cls')]])
    file_path = await converter.convert(wget.download(url))
    await res.edit("Generating Thumbnail")
    await generate_cover(requested_by, title, artist, duration, thumbnail)
    if message_.chat.id in callsmusic.pytgcalls.active_calls:
        await res.edit("adding in queue")
        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 res.edit_text(
            f"#️⃣ Lagu yang Anda minta **Sedang Antri** di posisi {position}")
    else:
        await res.edit_text("Lagu sudah di-mulai!.....")
        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 res.delete()

    m = await client.send_photo(
        chat_id=message_.chat.id,
        reply_markup=keyboard,
        photo="final.png",
        caption=f"⚡ **Sedang Memutar** Lagu [{title}]({url}) Via Deezer")
    os.remove("final.png")
示例#23
0
# Made By Devanagaraj
# Reference https://github.com/Devanagaraj/Tg_Meowzik_Bot
# Thanks to ARQ API

import os

from aiohttp import ClientSession
from Python_ARQ import ARQ
from userge import config, Message, userge
from .. import music
from ...misc.download import url_download

# ARQ API
session = ClientSession()
arq = ARQ("https://thearq.tech", music.ARQ_KEY,
          session) if music.ARQ_KEY else None

LOGGER = userge.getLogger(__name__)


@userge.on_cmd(
    "saavn",
    about={
        "header": "Search and Download Music",
        "description": "It Searches and Downloads Music from JioSaavn in HQ",
        "examples": "{tr}saavn name",
    },
)
async def savn(message: Message):
    if not music.ARQ_KEY:
        return await message.err(
示例#24
0
# Reference https://github.com/Devanagaraj/Tg_Meowzik_Bot
# Thanks to ARQ API

import os

from aiohttp import ClientSession
from Python_ARQ import ARQ
from userge import Config, Message, userge
from userge.plugins.misc.download import url_download

ARQ_KEY = os.environ.get("ARQ_KEY", None)

# ARQ API
session = ClientSession()
arq = ARQ("https://thearq.tech", ARQ_KEY, session) if ARQ_KEY else None

LOGGER = userge.getLogger(__name__)


@userge.on_cmd(
    "saavn",
    about={
        "header": "Search and Download Music",
        "description": "It Searches and Downloads Music from JioSaavn in HQ",
        "examples": "{tr}saavn name",
    },
)
async def savn(message: Message):
    if not ARQ_KEY:
        return await message.err(
示例#25
0
        from sample_config import SESSION_STRING

queue = []  # This is where the whole song queue is stored
playing = False  # Tells if something is playing or not
call = {}

# Pyrogram Client
if not HEROKU:
    app = Client("tgvc", api_id=API_ID, api_hash=API_HASH)
else:
    app = Client(SESSION_STRING, api_id=API_ID, api_hash=API_HASH)

# Pytgcalls Client

# Arq Client
arq = ARQ(ARQ_API, ARQ_API_KEY)


async def delete(message):
    await asyncio.sleep(10)
    await message.delete()


@app.on_message(
    filters.command("start")
    & ~filters.private
    & (filters.user(SUDOERS) | filters.chat(SUDO_CHAT_ID)))
async def start(_, message):
    await message.reply_text(START_TEXT, quote=False)

示例#26
0
async def deezer(client: Client, message_: Message):
    global que
    lel = await message_.reply("🔄 **Proses..**")
    administrators = await get_administrators(message_.chat)
    chid = message_.chat.id
    try:
        user = await USER.get_me()
    except:
        user.first_name = "𝗥𝗔𝗡𝗗𝗢𝗠 𝗠𝗨𝗦𝗜𝗞"
    usar = user
    wew = usar.id
    try:
        #chatdetails = await USER.get_chat(chid)
        lmoa = await client.get_chat_member(chid, wew)
    except:
        for administrator in administrators:
            if administrator == message_.from_user.id:
                try:
                    invitelink = await client.export_chat_invite_link(chid)
                except:
                    await lel.edit(
                        "<b>Tambahkan Saya Sebagai Admin di grup anda.</b>", )
                    return

                try:
                    await USER.join_chat(invitelink)
                    await USER.send_message(
                        message_.chat.id,
                        "Saya Telah bergabung dalam obrolan untuk memulai musik."
                    )
                    await lel.edit(
                        "<b>@asistan_random userbot telah bergabung.</b>", )

                except UserAlreadyParticipant:
                    pass
                except Exception as e:
                    #print(e)
                    await lel.edit(
                        f"<b>🔴 Flood Wait Error 🔴 \nUser {user.first_name} mungkin sudah melebihi kapasitas pemutaran."
                        "\n\nOr invit manual @asistan_random dan mencoba play ulang </b>",
                    )
                    pass
    try:
        chatdetails = await USER.get_chat(chid)
        #lmoa = await client.get_chat_member(chid,wew)
    except:
        await lel.edit(
            f"<i>Bot Tidak Bisa menjalan kan, Karna terjadi sesuatu hal, Coba Invite Asisstan secara manual @random_asisstan</i>"
        )
        return
    requested_by = message_.from_user.first_name

    text = message_.text.split(" ", 1)
    queryy = text[1]
    res = lel
    await res.edit(f"Searching 👀👀👀 for `{queryy}` on deezer")
    try:
        arq = ARQ("https://thearq.tech")
        r = await arq.deezer(query=queryy, limit=1)
        title = r[0]["title"]
        duration = int(r[0]["duration"])
        thumbnail = r[0]["thumbnail"]
        artist = r[0]["artist"]
        url = r[0]["url"]
    except:
        await res.edit(
            "Found Literally Nothing, You Should Work On Your English!")
        is_playing = False
        return
    keyboard = InlineKeyboardMarkup([[
        InlineKeyboardButton('📖 Playlist', callback_data='playlist'),
        InlineKeyboardButton('Menu ⏯ ', callback_data='menu')
    ], [InlineKeyboardButton(text="Listen On Deezer 🎬", url=f"{url}")
        ], [InlineKeyboardButton(text="❌ Close", callback_data='cls')]])
    file_path = await converter.convert(wget.download(url))
    await res.edit("Generating Thumbnail")
    await generate_cover(requested_by, title, artist, duration, thumbnail)
    if message_.chat.id in callsmusic.pytgcalls.active_calls:
        await res.edit("adding in queue")
        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 res.edit_text(
            f"✯𝗥𝗔𝗡𝗗𝗢𝗠 𝗠𝗨𝗦𝗜𝗞✯=#️⃣ Mengantri di posisi {position}")
    else:
        await res.edit_text("✯𝗥𝗔𝗡𝗗𝗢𝗠 𝗠𝗨𝗦𝗜𝗞✯=▶️ Dimulai.....")
        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 res.delete()

    m = await client.send_photo(chat_id=message_.chat.id,
                                reply_markup=keyboard,
                                photo="final.png",
                                caption=f"Playing [{title}]({url}) Via Deezer")
    os.remove("final.png")
示例#27
0
async def deezer(client: Client, message_: Message):
    global que
    lel = await message_.reply("🔄 **Memproses**")
    administrators = await get_administrators(message_.chat)
    chid = message_.chat.id
    try:
        user = await USER.get_me()
    except:
        user.first_name = "musicwan"
    usar = user
    wew = usar.id
    try:
        #chatdetails = await USER.get_chat(chid)
        lmoa = await client.get_chat_member(chid, wew)
    except:
        for administrator in administrators:
            if administrator == message_.from_user.id:
                try:
                    invitelink = await client.export_chat_invite_link(chid)
                except:
                    await lel.edit(
                        "<b>Add me as admin of yor group first</b>", )
                    return

                try:
                    await USER.join_chat(invitelink)
                    await USER.send_message(
                        message_.chat.id,
                        "I joined this group for playing music in VC")
                    await lel.edit(
                        "<b>@musicwan userbot joined your chat</b>", )

                except UserAlreadyParticipant:
                    pass
                except Exception as e:
                    #print(e)
                    await lel.edit(
                        f"<b>🔴 Flood Wait Error 🔴 \nUser {user.first_name} tidak dapat bergabung dengan grup Anda karena banyaknya permintaan untuk userbot! Pastikan pengguna tidak dilarang dalam grup."
                        "\n\nOr tambahkan @musicwan ke Grup Anda secara manual dan coba lagi</b>",
                    )
                    pass
    try:
        chatdetails = await USER.get_chat(chid)
        #lmoa = await client.get_chat_member(chid,wew)
    except:
        await lel.edit(
            f"<i>Sepertinya @musicwan Userbot tidak ada dalam obrolan ini, </Minta admin untuk mengirim / memainkan perintah untuk pertama kali atau adMinta admin untuk mengirim /play /help perintah untuk pertama kalinya atau tambahkan asisten secara manual <i>"
        )
        return
    requested_by = message_.from_user.first_name

    text = message_.text.split(" ", 1)
    queryy = text[1]
    res = lel
    await res.edit(f"Mencari 👀👀👀 di `{queryy}` on deezer")
    try:
        arq = ARQ("https://thearq.tech")
        r = await arq.deezer(query=queryy, limit=1)
        title = r[0]["title"]
        duration = int(r[0]["duration"])
        thumbnail = r[0]["thumbnail"]
        artist = r[0]["artist"]
        url = r[0]["url"]
    except:
        await res.edit(
            "Found Literally Nothing, You Should Work On Your English!")
        is_playing = False
        return
    keyboard = InlineKeyboardMarkup([[
        InlineKeyboardButton('📖 Playlist', callback_data='playlist'),
        InlineKeyboardButton('Menu ⏯ ', callback_data='menu')
    ], [InlineKeyboardButton(text="Listen On Deezer 🎬", url=f"{url}")
        ], [InlineKeyboardButton(text="❌ Close", callback_data='cls')]])
    file_path = await converter.convert(wget.download(url))
    await res.edit("Generating Thumbnail")
    await generate_cover(requested_by, title, artist, duration, thumbnail)
    if message_.chat.id in callsmusic.pytgcalls.active_calls:
        await res.edit("adding in queue")
        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 res.edit_text(f"#️⃣ Sedang dalam antrian di {position}")
    else:
        await res.edit_text("▶️ Playing.....")
        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 res.delete()

    m = await client.send_photo(chat_id=message_.chat.id,
                                reply_markup=keyboard,
                                photo="final.png",
                                caption=f"Playing [{title}]({url}) Via Deezer")
    os.remove("final.png")
示例#28
0
from DaisyXMusic.helpers.channelmusic import get_chat_id
from DaisyXMusic.helpers.errors import DurationLimitError
from DaisyXMusic.helpers.decorators import errors
from DaisyXMusic.helpers.decorators import authorized_users_only
from DaisyXMusic.helpers.filters import command
from DaisyXMusic.helpers.filters import other_filters
from DaisyXMusic.helpers.gets import get_file_name
from DaisyXMusic.services.callsmusic import callsmusic
from DaisyXMusic.services.callsmusic import client as USER
from DaisyXMusic.services.converter.converter import convert
from DaisyXMusic.services.downloaders import youtube
from DaisyXMusic.services.queues import queues

aiohttpsession = aiohttp.ClientSession()
chat_id = None
arq = ARQ("https://thearq.tech", ARQ_API_KEY, aiohttpsession)
DISABLED_GROUPS = []
useer ="NaN"
def cb_admin_check(func: Callable) -> Callable:
    async def decorator(client, cb):
        admemes = a.get(cb.message.chat.id)
        if cb.from_user.id in admemes:
            return await func(client, cb)
        else:
            await cb.answer("You ain't allowed!", show_alert=True)
            return

    return decorator


def transcode(filename):
示例#29
0
async def deezer(client: Client, message_: Message):
    global que
    lel = await message_.reply("🔄 **Sedang Memproses...**")
    administrators = await get_administrators(message_.chat)
    chid = message_.chat.id
    usar = await USER.get_me()
    wew = usar.id
    for administrator in administrators:
       if administrator == message_.from_user.id:  
               try:
                   invitelink = await client.export_chat_invite_link(chid)
               except:
                   await lel.edit(
                       "<b>Tambahkan saya sebagai admin grup Anda terlebih dahulu</b>",
                   )
                   return

               try:
                   await USER.join_chat(invitelink)
                   await lel.edit(
                       "<b>Asisten bot bergabung dengan obrolan Anda</b>",
                   )

               except UserAlreadyParticipant:
                   pass
               except Exception as e:
                   #print(e)
                   #await lel.edit(
                   #    f"<b>Pengguna {user.first_name} tidak bisa bergabung dengan grup Anda! Pastikan pengguna tidak diblokir dalam grup."
                   #    "\n\nAtau tambahkan @assistencrystal ke Grup Anda secara manual dan coba lagi</b>",
                   #)
                   pass
    try:
        chatdetails = await USER.get_chat(chid)
        #lmoa = await client.get_chat_member(chid,wew)
    except:
        await lel.edit(
            "<i>Asisten userbot tidak ada dalam obrolan ini, Minta admin untuk mengirim /play perintah untuk pertama kalinya atau menambahkan asisten secara manual</i>"
        )
        return                            
    requested_by = message_.from_user.first_name
    try:
        #chatdetails = await USER.get_chat(chid)
        lmoa = await client.get_chat_member(chid,wew)
    except:
        await lel.reply(
            "<i>Sepertinya Asisten Userbot tidak ada dalam obrolan ini, Minta admin untuk mengirim /play perintah untuk pertama kalinya atau menambahkan asisten secara manual</i>"
        )
        pass    

    text = message_.text.split(" ", 1)
    queryy = text[1]
    res = lel
    await res.edit(f"Sedang mencari...🔍 lagu `{queryy}` di deezer")
    try:
        arq = ARQ("https://thearq.tech")
        r = await arq.deezer(query=queryy, limit=1)
        title = r[0]["title"]
        duration = int(r[0]["duration"])
        thumbnail = r[0]["thumbnail"]
        artist = r[0]["artist"]
        url = r[0]["url"]
    except:
        await res.edit(
            "Lagu tidak ditemukan! Coba cari dengan judul lagu yang lebih jelas!"
        )
        is_playing = False
        return
    keyboard = InlineKeyboardMarkup(
         [   
             [
                 InlineKeyboardButton('📝 Playlist', callback_data='playlist'),
                 InlineKeyboardButton('Menu ⏯ ', callback_data='menu')     
             ],                     
             [
                    InlineKeyboardButton(
                        "Group Aku!", url="https://t.me/humangabutguys"
                    ),
                    InlineKeyboardButton(
                        "Owner Aku!", url="https://t.me/afterdaytoxic"
                    )
                ],
             [       
                 InlineKeyboardButton(
                     text="Tutup",
                     callback_data='cls')

            ]                      
         ]
     )
    file_path= await converter.convert(wget.download(url))
    await res.edit("Generating Thumbnail")
    await generate_cover(requested_by, title, artist, duration, thumbnail)
    if message_.chat.id in callsmusic.pytgcalls.active_calls:
        await res.edit("adding in queue")
        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 res.edit_text(f"Sedang memainkan [{title}]({url}) via Deezer")
    else:
        await res.edit_text("🎶 Memutar Lagu.....")
        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 res.delete()

    m = await client.send_photo(
        chat_id=message_.chat.id,
        reply_markup=keyboard,
        photo="final.png",
        caption=f"♬Irama Musik♬ > #️⃣ Mengantri di posisi {position}.)."
    ) 
    os.remove("final.png")