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

neteasemusic 3.0.6.2300 #197463

Merged
merged 3 commits into from
Jan 8, 2025
Merged

neteasemusic 3.0.6.2300 #197463

merged 3 commits into from
Jan 8, 2025

Conversation

niu541412
Copy link
Contributor

@niu541412 niu541412 commented Jan 7, 2025

Netease music V3 has been flagged as the stable version on its homepage and AppStore page. But it changed to
use a POST method to fetch its download link. See https://github.com/orgs/Homebrew/discussions/5756.

Important: Do not tick a checkbox if you haven’t performed its action. Honesty is indispensable for a smooth review process.

In the following questions <cask> is the token of the cask you're submitting.

After making any changes to a cask, existing or new, verify:

Additionally, if adding a new cask:

  • Named the cask according to the token reference.
  • Checked the cask was not already refused (add your cask's name to the end of the search field).
  • brew audit --cask --new <cask> worked successfully.
  • HOMEBREW_NO_INSTALL_FROM_API=1 brew install --cask <cask> worked successfully.
  • brew uninstall --cask <cask> worked successfully.

@niu541412 niu541412 changed the title netease v3 netease music v3 Jan 8, 2025
@p-linnane p-linnane requested a review from samford January 8, 2025 03:24
@khipp khipp added the livecheck Issues or PRs related to livecheck label Jan 8, 2025
Casks/n/neteasemusic.rb Outdated Show resolved Hide resolved
niu541412 and others added 3 commits January 8, 2025 08:35
The upstream download page (https://music.163.com/#/download) uses a
POST request to fetch download link information but livecheck doesn't
support POST requests yet. Additionally, the request parameters are
encrypted in a particular way (see
https://github.com/orgs/Homebrew/discussions/5756). That said, the
API endpoint appears to work with a simple `GET` request, so this
adds a `livecheck` block using the JSON strategy.
Copy link
Member

@samford samford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rebased this and pushed a commit with a working livecheck block.

As mentioned, the upstream download page (https://music.163.com/#/download) uses a POST request to fetch download link information but livecheck doesn't support POST requests yet. Additionally, the request parameters are encrypted in a particular way (see https://github.com/orgs/Homebrew/discussions/5756, https://github.com/zousandian/NeteaseCloudMusicApi/wiki/网易云音乐API分析---weapi). However, the same API endpoint appears to work with a simple GET request, so I've added a livecheck block that uses the JSON strategy to extract the version from the macOS download URL.

Copy link
Member

@samford samford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's hoping that this livecheck block holds up over time and we don't have to do anything more complicated. Thanks, @niu541412!

For what it's worth, livecheck will support POST requests sometime in the future. It relies on another feature that I've implemented but I'm having to refactor some parts of brew (for the sake of type checking) before I can create a PR for that work, so I'm a few PRs away from POST support.

@samford samford changed the title netease music v3 neteasemusic 3.0.6.2300 Jan 8, 2025
@samford samford merged commit ca254ab into Homebrew:master Jan 8, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
livecheck Issues or PRs related to livecheck
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants