Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(meta): use correct total disc number count #634

Merged
merged 3 commits into from
Jan 14, 2024

Conversation

miraclx
Copy link
Owner

@miraclx miraclx commented Jan 14, 2024

Deezer's API unfortunately, doesn't include any way to derive the total disc count of an album.

There's an alt-API we could use for this (which also provides us copyright information)

$ xh 'https://www.deezer.com/ajax/gw-light.php?method=deezer.getUserData&api_version=1.0&api_token=' \
  | jq '{cf: .results.checkForm, sid: .results.SESSION_ID}'
{
  "cf": "8MBdPkLVd3V~Exj0gJP0chXXXgM~2yb0",
  "sid": "fr0f7920da51b1f2b72dbbc7052a4a4141872d94"
}

$ xh 'https://www.deezer.com/ajax/gw-light.php?method=deezer.pageAlbum&api_version=1.0&api_token=8MBdPkLVd3V~Exj0gJP0chXXXgM~2yb0' \
    cookie:sid=fr0f7920da51b1f2b72dbbc7052a4a4141872d94 \
    alb_id:=264169542 lang=us \
  | jq -r '{total_discs: [.results.SONGS.data[] | .DISK_NUMBER] | unique | sort | reverse[0], copyright: .results.DATA.PRODUCER_LINE}'
{
  "total_discs": "3",
  "copyright": "(P) 2021 Floating World LTD"
}

Copy link

github-actions bot commented Jan 14, 2024


🐋 🤖

A docker image for this PR has been built!

docker pull freyrcli/freyrjs-git:pr-634
Base (master)
This Patch


What's this?

This docker image is a self-contained sandbox that includes all the patches made in this PR. Allowing others to easily use your patches without waiting for it to get merged and released officially.

For more context, see https://github.com/miraclx/freyr-js#docker-development.

@miraclx miraclx merged commit 437c505 into master Jan 14, 2024
18 checks passed
@miraclx miraclx deleted the miraclx/fix-total-discs-meta branch January 14, 2024 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant