Example #1
0
    def download_playlistdee(self,
                             URL,
                             output=stock_output,
                             quality=stock_quality,
                             recursive_quality=stock_recursive_quality,
                             recursive_download=stock_recursive_download,
                             not_interface=stock_not_interface,
                             zips=stock_zip):
        datas = []
        ids = utils.get_ids(URL)
        URL2 = self.api_playlist % ids
        playlist_json = utils.request(URL2, True).json()['tracks']['data']

        for a in playlist_json:
            URL3 = self.api_track % str(a['id'])

            try:
                detas = utils.tracking(URL3)
                datas.append(detas)
            except exceptions.NoDataApi:
                datas.append(None)

        details = {"datas": datas, "quality": quality, "output": output}

        names, zip_name = self.download(URL2, details, recursive_quality,
                                        recursive_download, not_interface,
                                        zips)

        if zips:
            return names, zip_name

        return names
Example #2
0
    def download_trackdee(self,
                          URL,
                          output=stock_output,
                          quality=stock_quality,
                          recursive_quality=stock_recursive_quality,
                          recursive_download=stock_recursive_download,
                          not_interface=stock_not_interface):
        datas = {}
        ids = utils.get_ids(URL)
        URL2 = self.api_track % ids
        datas = utils.tracking(URL2)

        details = {"datas": datas, "quality": quality, "output": output}

        name = self.download(URL2, details, recursive_quality,
                             recursive_download, not_interface)

        return name
Example #3
0
    def download_albumdee(
        self,
        URL,
        output=stock_output,
        quality=stock_quality,
        recursive_quality=stock_recursive_quality,
        recursive_download=stock_recursive_download,
        not_interface=stock_not_interface,
        zips=stock_zip,
    ):
        datas = {}
        datas["music"] = []
        datas["artist"] = []
        datas["tracknum"] = []
        datas["discnum"] = []
        datas["bpm"] = []
        datas["duration"] = []
        datas["isrc"] = []
        names = []
        ids = utils.get_ids(URL)
        URL2 = self.api_album % ids
        album_json = utils.request(URL2, True).json()
        datas["album"] = album_json["title"]
        datas["label"] = album_json["label"]
        datas["year"] = album_json["release_date"]
        datas["upc"] = album_json["upc"]
        datas["genre"] = []

        try:
            for a in album_json["genres"]["data"]:
                datas["genre"].append(a["name"])
        except KeyError:
            pass

        datas["genre"] = " & ".join(datas["genre"])
        datas["ar_album"] = []

        for a in album_json["contributors"]:
            if a["role"] == "Main":
                datas["ar_album"].append(a["name"])

        datas["ar_album"] = " & ".join(datas["ar_album"])

        for a in album_json["tracks"]["data"]:
            URL3 = self.api_track % str(a["id"])
            detas = utils.tracking(URL3, True)
            datas["music"].append(detas["music"])
            discnum = detas["discnum"]
            tracknum = detas["tracknum"]
            datas["tracknum"].append(tracknum)
            datas["discnum"].append(discnum)
            datas["bpm"].append(detas["bpm"])
            datas["duration"].append(detas["duration"])
            datas["isrc"].append(detas["isrc"])
            datas["artist"].append(detas["artist"])

        details = {"datas": datas, "quality": quality, "output": output}

        names, zip_name = self.download(
            URL2,
            details,
            recursive_quality,
            recursive_download,
            not_interface,
            zips,
        )

        if zips:
            return names, zip_name

        return names
Example #4
0
    def download_albumdee(self,
                          URL,
                          output=stock_output,
                          quality=stock_quality,
                          recursive_quality=stock_recursive_quality,
                          recursive_download=stock_recursive_download,
                          not_interface=stock_not_interface,
                          zips=stock_zip):
        datas = {}
        datas['music'] = []
        datas['artist'] = []
        datas['tracknum'] = []
        datas['discnum'] = []
        datas['bpm'] = []
        datas['duration'] = []
        datas['isrc'] = []
        names = []
        ids = utils.get_ids(URL)
        URL2 = self.api_album % ids
        album_json = utils.request(URL2, True).json()
        datas['album'] = album_json['title']
        datas['label'] = album_json['label']
        datas['year'] = album_json['release_date']
        datas['upc'] = album_json['upc']
        datas['genre'] = []

        try:
            for a in album_json['genres']['data']:
                datas['genre'].append(a['name'])
        except KeyError:
            pass

        datas['genre'] = " & ".join(datas['genre'])
        datas['ar_album'] = []

        for a in album_json['contributors']:
            if a['role'] == "Main":
                datas['ar_album'].append(a['name'])

        datas['ar_album'] = " & ".join(datas['ar_album'])

        for a in album_json['tracks']['data']:
            URL3 = self.api_track % str(a['id'])
            detas = utils.tracking(URL3, True)
            datas['music'].append(detas['music'])
            discnum = detas['discnum']
            tracknum = detas['tracknum']
            datas['tracknum'].append(tracknum)
            datas['discnum'].append(discnum)
            datas['bpm'].append(detas['bpm'])
            datas['duration'].append(detas['duration'])
            datas['isrc'].append(detas['isrc'])
            datas['artist'].append(detas['artist'])

        details = {"datas": datas, "quality": quality, "output": output}

        names, zip_name = self.download(URL2, details, recursive_quality,
                                        recursive_download, not_interface,
                                        zips)

        if zips:
            return names, zip_name

        return names