Slyyxp / rsack

Ransack「rsack」is a lossless Korean music downloader
MIT License
84 stars 12 forks source link

Circumvent `song/j_ArtistAlbumList.json` response limit. #11

Closed Slyyxp closed 2 years ago

Slyyxp commented 2 years ago

song/j_ArtistAlbumList.json responds with a maximum of 25 albums. This needs to be increased for artist batching to have any real value.

I am not aware how to circumvent this at the time of writing. One solution to obtaining the necessary album id's would be to scrape them although not ideal.

    def get_artist(self, id):
        """Returns artist information

        Args:
            id (int): Artist UID

        Returns:
            [dict]: API Response containing artist information
        """
        data = {
            "uxtk": self.usr_token,
            "sign": "Y",
            "tct": "Android",
            "svc": "IV",
            "stk": self.stm_token,
            "dcd": self.dev_id,
            "xxnm": id,
            "unm": self.usr_num,
            "mts": "Y"
        }
        r = self.make_call("app", "song/j_ArtistAlbumList.json", data)
        if r['Result']['RetCode'] != "0":
            logger.critical("Failed to retrieve metadata")
        return r
dannykym commented 2 years ago

"pgsize" parameter would increase the limit.

Slyyxp commented 2 years ago

1cd7f754e6417e9cb41d2a3bc7a5ee5842ce475a

Slyyxp commented 2 years ago

Had no idea on what I should've set pgsize to since the number of releases varies widely.