Merge pull request #200213 from Homebrew/bump-tidelift-1.14.0
[Homebrew/homebrew-cask.git] / Casks / n / neteasemusic.rb
blobee2aff4b823f08c2a8f7dda65a36cdadc0b07b59
1 cask "neteasemusic" do
2   version "3.0.11.2382"
3   sha256 "a59b040076f9372123011f380ab3073e43aea26b1fb13783ba598e64f0af0a03"
5   url "https://d1.music.126.net/dmusic/NeteaseCloudMusic_Music_official_#{version}.dmg",
6       verified:   "d1.music.126.net/",
7       user_agent: :fake
8   name "NetEase cloud music"
9   name "网易云音乐"
10   desc "Music streaming platform"
11   homepage "https://music.163.com/"
13   # The upstream download page (https://music.163.com/#/download) uses a POST
14   # request to fetch download link information but livecheck doesn't support
15   # POST requests yet. Additionally, the request parameters are encrypted in a
16   # particular way (see https://github.com/orgs/Homebrew/discussions/5756).
17   # That said, the API endpoint appears to work with a simple `GET` request.
18   livecheck do
19     url "https://music.163.com/api/appcustomconfig/get"
20     regex(/NeteaseCloudMusic[._-]Music[._-]official[._-]v?(\d+(?:[._]\d+)+)/i)
21     strategy :json do |json, regex|
22       json.dig("data", "web-new-download", "osx", "downloadUrl")&.[](regex, 1)
23     end
24   end
26   auto_updates true
27   depends_on macos: ">= :mojave"
29   app "NeteaseMusic.app"
31   uninstall quit: "com.netease.163music"
33   zap trash: [
34     "~/Library/Application Support/com.netease.163music",
35     "~/Library/Caches/com.netease.163music",
36     "~/Library/Containers/com.netease.163music",
37     "~/Library/Cookies/com.netease.163music.binarycookies",
38     "~/Library/HTTPStorages/com.netease.163music",
39     "~/Library/Preferences/com.netease.163music.plist",
40     "~/Library/Saved Application State/com.netease.163music.savedState",
41     "~/Library/WebKit/com.netease.163music",
42   ]
43 end