Пример #1
0
async def _(event):
    """DeezLoader by @An0nimia
    Ported for UniBorg by @SpEcHlDe"""
    if event.fwd_from:
        return
    
    strings = {
        "name": "DeezLoad",
        "arl_token_cfg_doc": "ARL Token for Deezer",
        "invalid_arl_token": "please set the required variables for this module",
        "wrong_cmd_syntax": "bruh, now i think how far should we go. please terminate my Session 🥺",
        "server_error": "We're experiencing technical difficulties.",
        "processing": "checking received input ?"
    }

    ARL_TOKEN = Config.DEEZER_ARL_TOKEN
    
    if ARL_TOKEN is None:
        await event.edit(strings["invalid_arl_token"])
        return

    try:
        loader = deezloader.Login(ARL_TOKEN)
    except Exception as er:
        await event.edit(str(er))
        return

    temp_dl_path = os.path.join(Config.TMP_DOWNLOAD_DIRECTORY, str(time.time()))
    if not os.path.exists(temp_dl_path):
        os.makedirs(temp_dl_path)

    required_link = event.pattern_match.group(1)
	required_qty = event.pattern_match.group(2)
Пример #2
0
def download(outputFolder):
    token = "884d9cf88f80e652ea8d78b64ed7cd1a60e7c7ecf2ee2c74811837ece0291b477e9c29e8e638b6a5c5b37cab0bf13b726cfb27fc09e55ecb74f5785dccee18c96a84220527d166b527f830c857a7b5128f4e3d194b78d8cb63bd6467c7d8c4e4"
    downloa = deezloader.Login(token)
    quality = "FLAC"
    output = outputFolder
    recursive_quality = False
    recursive_download = False
    not_gui = False
    song = ""
    artist = ""

    downQueue = db.getDownloadQueue()

    for songs in downQueue:
        song = songs[0]
        artist = songs[1]
        try:
            downloa.download_name(artist, song, output, quality,
                                  recursive_quality, recursive_download,
                                  not_gui)
            db.downloaded(song, artist)
        except deezloader.exceptions.TrackNotFound:
            print("Track not found")
Пример #3
0
def music(update, context):
    if not os.path.exists(TEMP_PATH):
        os.makedirs(TEMP_PATH)
    msg = update.effective_message
    args = context.args
    track = ""
    try:
        loader = deezloader.Login(ARL)
    except Exception as excp:
        msg.reply_text(f"Failed to load token. Error: {excp}")
        return
    try:
        flag = args[0]
        query = args[1]
    except IndexError:
        msg.reply_text("use format: /music <flag> <link/song name> <quality>")
        return
    quality = "MP3_320"
    if len(args) == 3:
        quality = args[2]
    message = msg.reply_text(f"Searching the music as {quality} . . .")
    try:
        if flag == "-link":
            if "deezer" in query:
                track = loader.download_trackdee(
                    query,
                    output=TEMP_PATH,
                    quality=quality,
                    recursive_quality=True,
                    recursive_download=True,
                    not_interface=True,
                )
            if "spotify" in query:
                track = loader.download_trackspo(
                    query,
                    output=TEMP_PATH,
                    quality=quality,
                    recursive_quality=True,
                    recursive_download=True,
                    not_interface=True,
                )
        if flag == "-song":
            if len(query.split("-")) == 2:
                artist, song = query.split("-")
            else:
                message.edit_text("read /help music plox on me")
                return
            track = loader.download_name(
                artist=artist,
                song=song,
                output=TEMP_PATH,
                recursive_quality=True,
                recursive_download=True,
                not_interface=True,
            )
    except NoDataApi:
        message.edit_text("Song Not Found *sad")
        return
    except Exception as excp:
        message.edit_text(f"Failed. Error: {excp}")
        return
    try:
        message.edit_text("Uploading music . . .")
        msg.reply_audio(audio=open(track, "rb"))
        message.edit_text("Done. :)")
    except FileNotFoundError:
        message.edit_text("read /help music plox on me")
    shutil.rmtree(TEMP_PATH)
Пример #4
0
import json
import shutil
import settings
import spotipy
import telepot
import acrcloud
import requests
import threading
import dwytsongs
import deezloader
from time import sleep
from bs4 import BeautifulSoup
import spotipy.oauth2 as oauth2
from telepot.namedtuple import ReplyKeyboardMarkup, KeyboardButton, InlineKeyboardMarkup, InlineKeyboardButton

downloa = deezloader.Login(settings.username, settings.password)
token = settings.token
bot = telepot.Bot(token)
stage = {}
users = {}
artist = {}
array2 = []
array3 = []
local = os.getcwd()
temp = 0
goes = 0
config = {
    "key": "d8d8e2b3e982d8413bd8f3f7f3b5b51a",
    "secret": "Xy0DL8AGiG4KBInav12P2TYMKSFRQYyclZyw3cu5",
    "host": "http://identify-eu-west-1.acrcloud.com"
}
Пример #5
0
    else:
        link = global_search(search_type)

        tracklink = True
        albumlink = False
    if ask_for_output == 'True':
        out = input('Cambiare Output (lasciare vuoto per standard)?\n')
    if len(out) == 0:
        output = check_output(standard_output)
    else:
        output = check_output(out)

# DEEZER DOWNLOADER
    try:
        download = deezloader.Login(requests.get('https://pastebin.com/raw/LkP0Hbkq').text)  # requests.get('https://pastebin.com/raw/LkP0Hbkq').text
    except deezloader.exceptions.BadCredentials:
        print('Invalid ARL token, please check you connection or try again later')
        input('Premi \'Invio\' per chiudere il programma')
        quit()
    except Exception:
        print('Trovato errore imprevisto...')
        input('Premi \'Invio\' per chiudere il programma')
        quit()
    if tracklink:
        try:
            download.download_trackspo(
                URL=link,
                output=output,
                quality="MP3_320",
                recursive_quality=True,
Пример #6
0
from pathlib import Path
from telegram.ext.dispatcher import run_async
from telegram.ext import CommandHandler, MessageHandler, Filters, ConversationHandler
from telegram import ForceReply, ReplyKeyboardMarkup
from pyrogram import Client

from acutebot import dp, typing, ARLTOKEN, LOG, APIID, APIHASH
from acutebot.helpers import strings as st

MUSIC, ARTIST, SENDMUSIC = range(3)
MUSICDICT = {}

if ARLTOKEN is not None:
    try:
        downloa = deezloader.Login(ARLTOKEN)
    except BadCredentials:
        print("Deezer token is dead :(")


@run_async
@typing
def musicq(update, context):
    reply_keyboard = [["🎵 256KBs", "🎧 320KBs", "🎶 FLAC"]]

    update.effective_message.reply_text(
        st.MUSICQ,
        reply_markup=ReplyKeyboardMarkup(reply_keyboard,
                                         one_time_keyboard=True,
                                         selective=True),
    )
Пример #7
0
                   "2": set_check,
                   "3": set_recursive}

        cmnd = input("> ")
        if cmnd == "4":
            break
        elif cmnd in commands:
            commands[cmnd]()
        else:
            print("Invalid Command!")
            time.sleep(0.4)

qualit, chec, recursiv = 0,0,0

if __name__ == "__main__":
    menu = {"1": download,
            "2": modify_parameters,
            "3": exit_app}

    dl = deezloader.Login("email", "password", "token")
    option, qualit, chec, recursiv = set_default_options(dl)
    while True:
        os.system('clear')
        print_menu()
        cmnd = input("> ")
        if cmnd in menu:
            menu[cmnd](option)
        else:
            print("Invalid Command!")
            time.sleep(0.4)
Пример #8
0
async def _(event):
    """DeezLoader by @An0nimia
    Ported for UniBorg by @SpEcHlDe"""
    if event.fwd_from:
        return

    strings = {
        "name": "DeezLoad",
        "arl_token_cfg_doc": "ARL Token for Deezer",
        "invalid_arl_token":
        "please set the required variables for this module",
        "wrong_cmd_syntax":
        "bruh, now i think how far should we go. please terminate my Session!",
        "server_error": "We're experiencing technical difficulties.",
        "Processando": "`Downloading...`",
        "enviando": "`Uploading...`",
    }

    ARL_TOKEN = DEEZER_ARL_TOKEN

    if ARL_TOKEN is None:
        await event.edit(strings["invalid_arl_token"])
        return

    try:
        loader = deezloader.Login(ARL_TOKEN)
    except Exception as er:
        await event.edit(str(er))
        return

    temp_dl_path = os.path.join(TEMP_DOWNLOAD_DIRECTORY, str(time.time()))
    if not os.path.exists(temp_dl_path):
        os.makedirs(temp_dl_path)

    required_link = event.pattern_match.group(1)
    required_qty = event.pattern_match.group(2)

    await event.edit(strings["Processando"])

    if "spotify" in required_link:
        if "track" in required_link:
            required_track = loader.download_trackspo(
                required_link,
                output=temp_dl_path,
                quality=required_qty,
                recursive_quality=True,
                recursive_download=True,
                not_interface=True,
            )
            await event.edit(strings["enviando"])
            await upload_track(required_track, event)
            shutil.rmtree(temp_dl_path)
            await event.delete()

        elif "album" in required_link:
            reqd_albums = loader.download_albumspo(
                required_link,
                output=temp_dl_path,
                quality=required_qty,
                recursive_quality=True,
                recursive_download=True,
                not_interface=True,
                zips=False,
            )
            await event.edit(strings["enviando"])
            for required_track in reqd_albums:
                await upload_track(required_track, event)
            shutil.rmtree(temp_dl_path)
            await event.delete()

    elif "deezer" in required_link:
        if "track" in required_link:
            required_track = loader.download_trackdee(
                required_link,
                output=temp_dl_path,
                quality=required_qty,
                recursive_quality=True,
                recursive_download=True,
                not_interface=True,
            )
            await event.edit(strings["enviando"])
            await upload_track(required_track, event)
            shutil.rmtree(temp_dl_path)
            await event.delete()

        elif "album" in required_link:
            reqd_albums = loader.download_albumdee(
                required_link,
                output=temp_dl_path,
                quality=required_qty,
                recursive_quality=True,
                recursive_download=True,
                not_interface=True,
                zips=False,
            )
            await event.edit(strings["enviando"])
            for required_track in reqd_albums:
                await upload_track(required_track, event)
            shutil.rmtree(temp_dl_path)
            await event.delete()

    else:
        await event.edit(strings["wrong_cmd_syntax"])
Пример #9
0
	acrcloud_key = config['acrcloud']['key']
	acrcloud_hash = config['acrcloud']['secret']
	acrcloud_host = config['acrcloud']['host']

	ya_key = config['yandex']['key']

	version = config['bot_info']['version']
	creator = config['bot_info']['creator']
	donation_link = config['bot_info']['donation']
	group_link = config['bot_info']['group']
except KeyError:
	print("Something went wrong with configuration file")
	sys.exit(0)

downloa = deezloader.Login(deezer_token)

bot = telepot.Bot(bot_token)
bot_name = bot.getMe()['username']

users = {}
qualit = {}
date = {}
languag = {}

del1 = 0
del2 = 0
free = 1
default_time = 0.8
is_audio = 0
Пример #10
0
async def _(event):
    if event.fwd_from:
        return

    strings = {
        "name": "DeezLoad",
        "arl_token_cfg_doc": "ARL Token for Deezer",
        "invalid_arl_token":
        "please set the required variables for this module",
        "wrong_cmd_syntax":
        "Bruh, sekarang kupikir seberapa jauh kita harus melangkah. tolong hentikan Sesi saya 🥺",
        "server_error": "Kami mengalami kesulitan teknis.",
        "processing": "`Mendownload..`",
        "uploading": "`Mengupload...`",
    }

    ARL_TOKEN = DEEZER_ARL_TOKEN

    if ARL_TOKEN is None:
        await event.edit(strings["invalid_arl_token"])
        return

    try:
        loader = deezloader.Login(ARL_TOKEN)
    except Exception as er:
        await event.edit(str(er))
        return

    temp_dl_path = os.path.join(TEMP_DOWNLOAD_DIRECTORY, str(time.time()))
    if not os.path.exists(temp_dl_path):
        os.makedirs(temp_dl_path)

    required_link = event.pattern_match.group(1)
    required_qty = event.pattern_match.group(2)

    await event.edit(strings["processing"])

    if "spotify" in required_link:
        if "track" in required_link:
            required_track = loader.download_trackspo(
                required_link,
                output=temp_dl_path,
                quality=required_qty,
                recursive_quality=True,
                recursive_download=True,
                not_interface=True,
            )
            await event.edit(strings["uploading"])
            await upload_track(required_track, event)
            shutil.rmtree(temp_dl_path)
            await event.delete()

        elif "album" in required_link:
            reqd_albums = loader.download_albumspo(
                required_link,
                output=temp_dl_path,
                quality=required_qty,
                recursive_quality=True,
                recursive_download=True,
                not_interface=True,
                zips=False,
            )
            for required_track in reqd_albums:
                await event.edit(strings["uploading"])
                await upload_track(required_track, event)
            shutil.rmtree(temp_dl_path)
            await event.delete()

    elif "deezer" in required_link:
        if "track" in required_link:
            required_track = loader.download_trackdee(
                required_link,
                output=temp_dl_path,
                quality=required_qty,
                recursive_quality=True,
                recursive_download=True,
                not_interface=True,
            )
            await upload_track(required_track, event)
            await event.edit(strings["uploading"])
            shutil.rmtree(temp_dl_path)
            await event.delete()

        elif "album" in required_link:
            reqd_albums = loader.download_albumdee(
                required_link,
                output=temp_dl_path,
                quality=required_qty,
                recursive_quality=True,
                recursive_download=True,
                not_interface=True,
                zips=False,
            )
            for required_track in reqd_albums:
                await event.edit(strings["uploading"])
                await upload_track(required_track, event)
            shutil.rmtree(temp_dl_path)
            await event.delete()

    else:
        await event.edit(strings["wrong_cmd_syntax"])
Пример #11
0
async def deezload(message: Message):
    if not os.path.exists(TEMP_PATH):
        os.makedirs(TEMP_PATH)
    if not message.flags:
        await message.edit(
            "Hello, this plugin requires a proper flag to be passed...")
        return
    await message.edit("Checking your token.")
    if ARL_TOKEN is None:
        await message.edit(ARL_HELP, disable_web_page_preview=True)
        return
    try:
        loader = deezloader.Login(ARL_TOKEN)
    except Exception as er:
        await message.edit(er)
        await Clogger.log(f"#ERROR\n\n{er}")
        return

    flags = list(message.flags)
    to_zip = "-zip" in flags
    d_quality = "MP3_320"
    if not message.filtered_input_str:
        await message.edit("Tell me how to download `nothing`...")
        return
    input_ = message.filtered_input_str
    if "-dsong" not in flags:
        try:
            input_link, quality = input_.split()
        except ValueError:
            if len(input_.split()) == 1:
                input_link = input_
                quality = d_quality
            else:
                await message.edit("Invalid Syntax Detected. 🙂")
                return
        if not re.search(rex, input_link):
            await message.edit(
                "As per my Blek Mejik Regex, this link is not supported.")
            return
    else:
        try:
            artist, song, quality = input_.split("-")
        except ValueError:
            if len(input_.split("-")) == 2:
                artist, song = input_.split("-")
                quality = d_quality
            else:
                await message.edit(
                    "Give [{artist name} - {song name}-{quality(optional)}]..."
                )
                return
        artist = artist.strip()
        artist_n = artist.split()
        a = []
        for a_name in artist_n:
            a_name = a_name.capitalize()
            a.append(a_name)
        artist = " ".join(a)

        song = song.strip()
        song_n = song.split()
        s = []
        for s_name in song_n:
            s_name = s_name.capitalize()
            s.append(s_name)
        song = " ".join(s)
    try:
        if ("-sdl" in flags and "track/" in input_link
                or "-ddl" in flags and "track/" in input_link):
            await proper_trackdl(input_link, quality, message, loader,
                                 TEMP_PATH)
        elif "-sdl" in flags or "-ddl" in flags:
            await batch_dl(input_link, quality, message, loader, TEMP_PATH,
                           to_zip)
    except NoDataApi as nd:
        await message.edit("No Data is available for input link")
        await Clogger.log(f"#ERROR\n\n{nd}")
    except Exception as e_r:
        await Clogger.log(f"#ERROR\n\n{e_r}")

    if "-dsong" in flags:
        await message.edit(
            f"Searching results for **{artist} - {song}**({quality})...")
        try:
            track = await pool.run_in_thread(loader.download_name)(
                artist=artist.strip(),
                song=song.strip(),
                output=TEMP_PATH,
                quality=quality.strip(),
                recursive_quality=True,
                recursive_download=True,
                not_interface=True,
            )
            await message.edit("Song found, now uploading 📤...", del_in=5)
            await audio_upload(message=message,
                               path=Path(track),
                               del_path=True)
        except Exception as e_r:
            await message.edit("Song not nound 🚫...")
            await Clogger.log(f"#ERROR\n\n{e_r}")

    await message.delete()
    shutil.rmtree(TEMP_PATH, ignore_errors=True)
Пример #12
0
import deezloader
import os
import urllib.request
import glob
import telepot
import telegram
from client import Client
from telepot.namedtuple import ReplyKeyboardMarkup, KeyboardButton, InlineKeyboardButton, InlineKeyboardMarkup

client = Client()
dw = deezloader.Login("*****@*****.**", "camillo01")
global typeDown
typeDown = []

def on_chat_message(msg):
	content_type, chat_type, chat_id = telepot.glance(msg)

	global mex
	global search

	keyboard = [[[]]]
	search = bot.getUpdates()[0]['message']['text']
	#print(search)

	start = InlineKeyboardMarkup(inline_keyboard=[
		[InlineKeyboardButton(text="🔍 Cerca", callback_data="search"),]])

	if content_type == 'text':
		if len(typeDown) > 0:
			if typeDown[0] == 'album' and search[0] != '🎵': 
				infos = client.list_title_results_album(search)
Пример #13
0
async def music(client, message):
    if not os.path.exists(TEMP_PATH):
        os.makedirs(TEMP_PATH)
    args = message.text.split()
    track = ""
    try:
        loader = deezloader.Login(ARL)
    except Exception as excp:
        await message.reply_text(f"Failed to load token. Error: {excp}")
        return
    try:
        flag = args[1]
        query = args[2]
    except IndexError:
        await message.reply_text(
            "use format: `/music` <flag> <link/song name> <quality>", parse_mode="markdown")
        return
    quality = "MP3_320"
    if len(args) == 4:
        quality = args[3]
    msg = await message.reply_text(f"Searching the music as {quality} . . .")
    try:
        if flag == "-link":
            if "deezer" in query:
                track = loader.download_trackdee(
                    query,
                    output=TEMP_PATH,
                    quality=quality,
                    recursive_quality=True,
                    recursive_download=True,
                    not_interface=True,
                )
            if "spotify" in query:
                track = loader.download_trackspo(
                    query,
                    output=TEMP_PATH,
                    quality=quality,
                    recursive_quality=True,
                    recursive_download=True,
                    not_interface=True,
                )
        if flag == "-song":
            if len(query.split("-")) == 2:
                artist, song = query.split("-")
            else:
                await msg.edit_text("read /help music plox on me")
                return
            track = loader.download_name(
                artist=artist,
                song=song,
                output=TEMP_PATH,
                recursive_quality=True,
                recursive_download=True,
                not_interface=True,
            )
    except NoDataApi:
        await msg.edit_text("Song Not Found *sad")
        return
    except Exception as excp:
        await msg.edit_text(f"Failed. Error: {excp}")
        return
    try:
        await asyncio.gather(
            msg.edit_text("Uploading music . . ."),
            msg.reply_audio(audio=open(track, "rb")),
            msg.edit_text("Done. :)"),
        )
    except FileNotFoundError:
        await msg.edit_text("read /help music plox on me")
    shutil.rmtree(TEMP_PATH)
Пример #14
0
    older_folder = song.split('/')[:2]  # Taking the Main Folder
    shutil.rmtree(older_folder[0] + '/' + older_folder[1])

    # Opening Folder With Album
    real_path = os.path.realpath('./download/' + directory)
    os.startfile(real_path)

    return real_path


def cover(path, info_album):
    urllib.request.urlretrieve(info_album['cover_xl'], path + '/cover.png')


d = deezloader.Login('ARL TOKER HERE')

while True:
    query = input("Search for Album : ")

    link = 'https://api.deezer.com/search/album?q=' + query
    response = requests.get(link)

    # Writing Response in File JSON
    with open('received.json', 'w+') as f:
        f.write(response.text)

    # Creating a Dict from Response
    parsed = json.loads(response.text)

    info = """
Пример #15
0
async def _(event):
    """DeezLoader by @An0nimia
    Ported for UniBorg by @SpEcHlDe"""
    if event.fwd_from:
        return

    strings = {
        "name": "DeezLoad",
        "arl_token_cfg_doc": "ARL Token untuk Deezer",
        "invalid_arl_token":
        "tolong setel variabel yang dibutuhkan untuk modul ini",
        "wrong_cmd_syntax":
        "bruh, sekarang saya pikir seberapa jauh kita harus melangkah. tolong hentikan Sesi saya!",
        "server_error": "Terjadi kesalahan teknis.",
        "processing": "`Sedang Mendownload..`",
        "uploading": "`Sedang Mengunggah...`",
    }

    ARL_TOKEN = DEEZER_ARL_TOKEN

    if ARL_TOKEN is None:
        await event.edit(strings["invalid_arl_token"])
        return

    try:
        loader = deezloader.Login(ARL_TOKEN)
    except Exception as er:
        await event.edit(str(er))
        return

    temp_dl_path = os.path.join(TEMP_DOWNLOAD_DIRECTORY, str(time.time()))
    if not os.path.exists(temp_dl_path):
        os.makedirs(temp_dl_path)

    required_link = event.pattern_match.group(1)
    required_qty = event.pattern_match.group(2)

    await event.edit(strings["processing"])

    if "spotify" in required_link:
        if "track" in required_link:
            required_track = loader.download_trackspo(
                required_link,
                output=temp_dl_path,
                quality=required_qty,
                recursive_quality=True,
                recursive_download=True,
                not_interface=True,
            )
            await event.edit(strings["uploading"])
            await upload_track(required_track, event)
            shutil.rmtree(temp_dl_path)
            await event.delete()

        elif "album" in required_link:
            reqd_albums = loader.download_albumspo(
                required_link,
                output=temp_dl_path,
                quality=required_qty,
                recursive_quality=True,
                recursive_download=True,
                not_interface=True,
                zips=False,
            )
            await event.edit(strings["uploading"])
            for required_track in reqd_albums:
                await upload_track(required_track, event)
            shutil.rmtree(temp_dl_path)
            await event.delete()

    elif "deezer" in required_link:
        if "track" in required_link:
            required_track = loader.download_trackdee(
                required_link,
                output=temp_dl_path,
                quality=required_qty,
                recursive_quality=True,
                recursive_download=True,
                not_interface=True,
            )
            await event.edit(strings["uploading"])
            await upload_track(required_track, event)
            shutil.rmtree(temp_dl_path)
            await event.delete()

        elif "album" in required_link:
            reqd_albums = loader.download_albumdee(
                required_link,
                output=temp_dl_path,
                quality=required_qty,
                recursive_quality=True,
                recursive_download=True,
                not_interface=True,
                zips=False,
            )
            await event.edit(strings["uploading"])
            for required_track in reqd_albums:
                await upload_track(required_track, event)
            shutil.rmtree(temp_dl_path)
            await event.delete()

    else:
        await event.edit(strings["wrong_cmd_syntax"])
Пример #16
0
import setting
import logging
import acrcloud
import requests
import dwytsongs
import deezloader
from time import sleep
from pprint import pprint
from mutagen.mp3 import MP3
from threading import Thread
from mutagen.flac import FLAC
from bs4 import BeautifulSoup
import spotipy.oauth2 as oauth2
from mutagen.easyid3 import EasyID3
from telepot.namedtuple import ReplyKeyboardMarkup, KeyboardButton, ReplyKeyboardRemove, InlineKeyboardMarkup, InlineKeyboardButton, InlineQueryResultArticle, InputTextMessageContent
downloa = deezloader.Login(setting.username, setting.password,
                           setting.deezer_token)
token = setting.token
bot = telepot.Bot(token)
users = {}
qualit = {}
date = {}
languag = {}
del1 = 0
del2 = 0
local = os.getcwd()
db_file = local + "/dwsongs.db"
loc_dir = local + "/Songs/"
config = {
    "key": "de46e5c7420b418d73717c6b9ab0ba79",
    "secret": "IQzjk1uwooSt7ilW7wt872QlcFMuO51zaZ0gw4xQ",
    "host": "https://identify-eu-west-1.acrcloud.com"
Пример #17
0
async def deezload(message: Message):
    cmd = str(message.text)[0]
    if not os.path.exists(TEMP_PATH):
        os.makedirs(TEMP_PATH)
    await message.edit("Checking your Token.")
    if ARL_TOKEN is None:
        await message.edit(ARL_HELP, disable_web_page_preview=True)
        return
    try:
        loader = deezloader.Login(ARL_TOKEN)
    except Exception as er:
        await message.edit(er)
        await Clogger.log(f"#ERROR\n\n{er}")
        return

    flags = list(message.flags)
    if "-zip" not in flags:
        to_zip = False
    else:
        to_zip = True
    d_quality = "MP3_320"
    if not message.filtered_input_str:
        await message.edit("Olá Peru Master🙂, Tell me how to download `Nothing`")
        return
    input_ = message.filtered_input_str
    if "-dsong" not in flags:
        try:
            input_link, quality = input_.split()
        except ValueError:
            if len(input_.split()) == 1:
                input_link = input_
                quality = d_quality
            else:
                await message.edit("Invalid Syntax Detected. 🙂")
                return
        if not REX.search(input_link):
            await message.edit(
                ">.< this link is not supported."
            )
            return
    else:
        try:
            artist, song, quality = input_.split("-")
        except ValueError:
            if len(input_.split("-")) == 2:
                artist, song = input_.split("-")
                quality = d_quality
            else:
                await message.edit(f"🙂K!! Check `{cmd}help deezload`")
                return
        await message.edit(f"Searching Results for {song}")
        try:
            track = await pool.run_in_thread(loader.download_name)(
                artist=artist.strip(),
                song=song.strip(),
                output=TEMP_PATH,
                quality=quality.strip(),
                recursive_quality=True,
                recursive_download=True,
                not_interface=True,
            )
            await message.edit("Song found, Now Uploading 📤", del_in=5)
            await audio_upload(message, Path(track), True)
        except Exception as e_r:
            await message.edit("Song not Found 🚫")
            await Clogger.log(f"#ERROR\n\n{e_r}")
        await message.delete()
        shutil.rmtree(TEMP_PATH, ignore_errors=True)
        return

    try:
        if "track/" in input_link:
            await proper_trackdl(input_link, quality, message, loader, TEMP_PATH)
        else:
            await batch_dl(input_link, quality, message, loader, TEMP_PATH, to_zip)
    except NoDataApi as nd:
        await message.edit("No Data is available for input link")
        await Clogger.log(f"#ERROR\n\n{nd}")
    except Exception as e_r:
        await Clogger.log(f"#ERROR\n\n{e_r}")

    await message.delete()
    shutil.rmtree(TEMP_PATH, ignore_errors=True)
Пример #18
0
        tracklink = False
        albumlink = False

    else:
        link = global_search(search_type)

        tracklink = True
        albumlink = False
    out = input('Change output? (leave empty for standard)\n')
    if len(out) == 0:
        output = check_output(standard_output)
    else:
        output = check_output(out)

    # DEEZER DOWNLOADER
    download = deezloader.Login("your ARL token here")
    if tracklink:
        try:
            download.download_trackspo(
                URL=link,
                output=output,
                quality="MP3_320",
                recursive_quality=True,
                recursive_download=False,
                not_interface=False
            )
        except(deezloader.exceptions.TrackNotFound, deezloader.exceptions.NoDataApi, deezloader.exceptions.InvalidLink):
            print('Couldn\'t find the song :(\n')
            quit()

    elif albumlink:
Пример #19
0
async def deezload(message: Message):
    if not os.path.exists(PATH):
        os.makedirs(PATH)
    if not message.flags:
        await message.edit(
            "Check your E-Mail📧 I've sent an invitation to read help for DeezLoader :)")
        return
    await message.edit("Trying to Login 🥴")
    if ARL_TOKEN is None:
        await message.edit(ARL_HELP, disable_web_page_preview=True)
        return
    try:
        loader = deezloader.Login(ARL_TOKEN)
    except Exception as er:
        await message.edit(er)
        return

    flags = list(message.flags)
    if '-zip' not in flags:
        to_zip = False
    else:
        to_zip = True
    d_quality = "MP3_320"
    if not message.filtered_input_str:
        await message.edit("Bruh, Now I Think how far should we go. Plz Terminate my Session 🥺")
        return
    input_ = message.filtered_input_str
    if '-dsong' not in flags:
        try:
            input_link, quality = input_.split()
        except ValueError:
            if len(input_.split()) == 1:
                input_link = input_
                quality = d_quality
            else:
                await message.edit("🤔 Comedy? You are good at it")
                return
        if '.com' not in input_link:
            await message.edit("Invalid Link")
            return
    elif '-dsong' in flags:
        try:
            artist, song, quality = input_.split('-')
        except ValueError:
            if len(input_.split("-")) == 2:
                artist, song = input_.split('-')
                quality = d_quality
            else:
                await message.edit("WeW, Use that thing which is present on top floor of ur body 🌚")
                return

    if '-sdl' in flags:
        if 'track/' in input_link:
            await proper_trackdl(input_link, quality, message, loader, PATH)
        elif 'album/' or 'playlist/' in input_link:
            await batch_dl(input_link, quality, message, loader, PATH, userge, to_zip)
    elif '-ddl' in flags:
        if 'track/' in input_link:
            await proper_trackdl(input_link, quality, message, loader, PATH)
        elif 'album/' or 'playlist/' in input_link:
            await batch_dl(input_link, quality, message, loader, PATH, userge, to_zip)

    if '-dsong' in flags:
        await message.edit("Searching for Song 🔍")
        try:
            track = loader.download_name(
                artist=artist,
                song=song,
                output=PATH,
                quality=quality,
                recursive_quality=True,
                recursive_download=True,
                not_interface=True
            )
            await message.edit("Song found, Now Uploading 📤")
            await uload_tg(track, message)
        except Exception:
            await message.edit("Song not Found 🚫")
    await message.delete()
    shutil.rmtree(PATH, ignore_errors=True)
Пример #20
0
async def deezload(message: Message):
    if not os.path.exists(TEMP_PATH):
        os.makedirs(TEMP_PATH)
    if not message.flags:
        await message.edit(
            "Hello🙂, This Plugin requires a proper flag to be passed.")
        return
    await message.edit("Checking your Token.")
    if ARL_TOKEN is None:
        await message.edit(ARL_HELP, disable_web_page_preview=True)
        return
    try:
        loader = deezloader.Login(ARL_TOKEN)
    except Exception as er:
        await message.edit(er)
        await Clogger.log(f"#ERROR\n\n{er}")
        return

    flags = list(message.flags)
    if '-zip' not in flags:
        to_zip = False
    else:
        to_zip = True
    d_quality = "MP3_320"
    if not message.filtered_input_str:
        await message.edit(
            "Olá Peru Master🙂, Tell me how to download `Nothing`")
        return
    input_ = message.filtered_input_str
    if '-dsong' not in flags:
        try:
            input_link, quality = input_.split()
        except ValueError:
            if len(input_.split()) == 1:
                input_link = input_
                quality = d_quality
            else:
                await message.edit("Invalid Syntax Detected. 🙂")
                return
        if not re.search(rex, input_link):
            await message.edit(
                "As per my Blek Mejik Regex, this link is not supported.")
            return
    elif '-dsong' in flags:
        try:
            artist, song, quality = input_.split('-')
        except ValueError:
            if len(input_.split("-")) == 2:
                artist, song = input_.split('-')
                quality = d_quality
            else:
                await message.edit("🙂K!!")
                return
    try:
        if '-sdl' in flags:
            if 'track/' in input_link:
                await proper_trackdl(input_link, quality, message, loader,
                                     TEMP_PATH)
            elif 'album/' or 'playlist/' in input_link:
                await batch_dl(input_link, quality, message, loader, TEMP_PATH,
                               to_zip)
        elif '-ddl' in flags:
            if 'track/' in input_link:
                await proper_trackdl(input_link, quality, message, loader,
                                     TEMP_PATH)
            elif 'album/' or 'playlist/' in input_link:
                await batch_dl(input_link, quality, message, loader, TEMP_PATH,
                               to_zip)
    except NoDataApi as nd:
        await message.edit("No Data is available for input link")
        await Clogger.log(f"#ERROR\n\n{nd}")
    except Exception as e_r:
        await Clogger.log(f"#ERROR\n\n{e_r}")

    if '-dsong' in flags:
        await message.edit(f"Searching Results for {song}")
        try:
            track = await pool.run_in_thread(loader.download_name
                                             )(artist=artist.strip(),
                                               song=song.strip(),
                                               output=TEMP_PATH,
                                               quality=quality.strip(),
                                               recursive_quality=True,
                                               recursive_download=True,
                                               not_interface=True)
            await message.edit("Song found, Now Uploading 📤", del_in=5)
            await audio_upload(message, Path(track), True)
        except Exception as e_r:
            await message.edit("Song not Found 🚫")
            await Clogger.log(f"#ERROR\n\n{e_r}")

    await message.delete()
    shutil.rmtree(TEMP_PATH, ignore_errors=True)
Пример #21
0
async def _(event):
    """DeezLoader by @An0nimia. Ported for UniBorg by @SpEcHlDe"""
    if event.fwd_from:
        return

    strings = {
        "name": "DeezLoad",
        "arl_token_cfg_doc": "ARL Token for Deezer",
        "invalid_arl_token":
        "please set the required variables for this module",
        "wrong_cmd_syntax":
        "bruh, now i think how far should we go. please terminate my Session.",
        "server_error": "We're experiencing technical difficulties.",
        "processing": "`Downloading...`",
        "uploading": "`Uploading...`",
    }

    ARL_TOKEN = DEEZER_ARL_TOKEN

    if ARL_TOKEN is None:
        await event.edit(strings["invalid_arl_token"])
        return

    try:
        loader = deezloader.Login(ARL_TOKEN)
    except Exception as er:
        await event.edit(str(er))
        return

    temp_dl_path = os.path.join(TEMP_DOWNLOAD_DIRECTORY, str(time.time()))
    if not os.path.exists(temp_dl_path):
        os.makedirs(temp_dl_path)

    required_link = event.pattern_match.group(1)
    required_qty = event.pattern_match.group(2)
    required_qty = required_qty.strip() if required_qty else "MP3_320"

    await event.edit(strings["processing"])

    if "spotify" in required_link:
        if "track" in required_link:
            required_track = loader.download_trackspo(
                required_link,
                output=temp_dl_path,
                quality=required_qty,
                recursive_quality=True,
                recursive_download=True,
                not_interface=True,
            )
            await event.edit(strings["uploading"])
            await upload_track(required_track, event)
            shutil.rmtree(temp_dl_path)
            await event.delete()

        elif "album" in required_link:
            reqd_albums = loader.download_albumspo(
                required_link,
                output=temp_dl_path,
                quality=required_qty,
                recursive_quality=True,
                recursive_download=True,
                not_interface=True,
                zips=False,
            )
            await event.edit(strings["uploading"])
            for required_track in reqd_albums:
                await upload_track(required_track, event)
            shutil.rmtree(temp_dl_path)
            await event.delete()

    elif "deezer" in required_link:
        if "track" in required_link:
            required_track = loader.download_trackdee(
                required_link,
                output=temp_dl_path,
                quality=required_qty,
                recursive_quality=True,
                recursive_download=True,
                not_interface=True,
            )
            await event.edit(strings["uploading"])
            await upload_track(required_track, event)
            shutil.rmtree(temp_dl_path)
            await event.delete()

        elif "album" in required_link:
            reqd_albums = loader.download_albumdee(
                required_link,
                output=temp_dl_path,
                quality=required_qty,
                recursive_quality=True,
                recursive_download=True,
                not_interface=True,
                zips=False,
            )
            await event.edit(strings["uploading"])
            for required_track in reqd_albums:
                await upload_track(required_track, event)
            shutil.rmtree(temp_dl_path)
            await event.delete()

    elif "now" in required_link:
        playing = User(LASTFM_USERNAME, lastfm).get_now_playing()
        artist = str(playing.get_artist())
        song = str(playing.get_title())
        try:
            required_track = loader.download_name(
                artist=artist,
                song=song,
                output=temp_dl_path,
                quality=required_qty,
                recursive_quality=True,
                recursive_download=True,
                not_interface=True,
            )
        except BaseException as err:
            await event.edit(f"**ERROR :** {err}")
            await asyncio.sleep(5)
            return
        await event.edit(strings["uploading"])
        await upload_track(required_track, event)
        shutil.rmtree(temp_dl_path)
        await event.delete()

    else:
        await event.edit(strings["wrong_cmd_syntax"])
Пример #22
0
async def deezload(message: Message):
    if not os.path.exists(TEMP_PATH):
        os.makedirs(TEMP_PATH)
    if not message.flags:
        await message.edit(
            "Hello🙂, This Plugin requires a proper flag to be passed.")
        return
    await message.edit("Bentar lagi cek token")
    if ARL_TOKEN is None:
        await message.edit(ARL_HELP, disable_web_page_preview=True)
        return
    try:
        loader = deezloader.Login(ARL_TOKEN)
    except Exception as er:
        await message.edit(er)
        await Clogger.log(f"#ERROR\n\n{er}")
        return

    flags = list(message.flags)
    if '-zip' not in flags:
        to_zip = False
    else:
        to_zip = True
    d_quality = "MP3_320"
    if not message.filtered_input_str:
        await message.edit("Hadehhh link nya mana mastahh`")
        return
    input_ = message.filtered_input_str
    if '-dsong' not in flags:
        try:
            input_link, quality = input_.split()
        except ValueError:
            if len(input_.split()) == 1:
                input_link = input_
                quality = d_quality
            else:
                await message.edit("Syntax gagal 🙂")
                return
        if not re.search(rex, input_link):
            await message.edit("Link nya ga support nih :(.")
            return
    elif '-dsong' in flags:
        try:
            artist, song, quality = input_.split('-')
        except ValueError:
            if len(input_.split("-")) == 2:
                artist, song = input_.split('-')
                quality = d_quality
            else:
                await message.edit("Hmm")
                return
    try:
        if '-sdl' in flags:
            if 'track/' in input_link:
                await proper_trackdl(input_link, quality, message, loader,
                                     TEMP_PATH)
            elif 'album/' or 'playlist/' in input_link:
                await batch_dl(input_link, quality, message, loader, TEMP_PATH,
                               to_zip)
        elif '-ddl' in flags:
            if 'track/' in input_link:
                await proper_trackdl(input_link, quality, message, loader,
                                     TEMP_PATH)
            elif 'album/' or 'playlist/' in input_link:
                await batch_dl(input_link, quality, message, loader, TEMP_PATH,
                               to_zip)
    except NoDataApi as nd:
        await message.edit("Data nya ngk ada om :(")
        await Clogger.log(f"#ERROR\n\n{nd}")
    except Exception as e_r:
        await Clogger.log(f"#ERROR\n\n{e_r}")

    if '-dsong' in flags:
        await message.edit(f"Bentar lagi nyari {song}")
        try:
            track = await pool.run_in_thread(loader.download_name
                                             )(artist=artist.strip(),
                                               song=song.strip(),
                                               output=TEMP_PATH,
                                               quality=quality.strip(),
                                               recursive_quality=True,
                                               recursive_download=True,
                                               not_interface=True)
            await message.edit(
                "Lagu yang kamu cari ada, bentar lg upload 📤", del_in=5)
            await audio_upload(message, Path(track), True)
        except Exception as e_r:
            await message.edit("Lagu nya gk ada :(🚫")
            await Clogger.log(f"#ERROR\n\n{e_r}")

    await message.delete()
    shutil.rmtree(TEMP_PATH, ignore_errors=True)