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

Add YouTube Music v1.20.0 #148404

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions Casks/youtube-music.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
cask "youtube-music" do
Copy link
Contributor

Choose a reason for hiding this comment

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

This is an unofficial client, should it be renamed to youtube-music-th-ch ? What happens if YouTube Music makes a native app in the future?

Copy link

Choose a reason for hiding this comment

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

It should be renamed, although there is another unnofficial client called yt-music.

version "1.20.0"
sha256 "b776009ddc9138e25cda177e992044ce716e362e0ad1739a5f1f7c388c51fa46"

url "https://github.com/th-ch/youtube-music/releases/download/v#{version}/YouTube-Music-#{version}.dmg",
verified: "github.com/th-ch/youtube-music/"
name "YouTube Music"
desc "Desktop App bundled with custom plugins (and built-in ad blocker / downloader)"
homepage "https://th-ch.github.io/youtube-music/"

livecheck do
url "https://github.com/th-ch/youtube-music/releases/latest"
regex(%r{href=.*?/YouTube-Music-(\d+(?:\.\d+)+)\.dmg}i)
strategy :header_match do |headers, regex|
next if headers["location"].blank?

# Identify the latest tag from the response's `location` header
latest_tag = File.basename(headers["location"])
next if latest_tag.blank?

# Fetch the assets list HTML for the latest tag and match within it
assets_page = Homebrew::Livecheck::Strategy.page_content(
@url.sub(%r{/releases/?.+}, "/releases/expanded_assets/#{latest_tag}"),
)
assets_page[:content]&.scan(regex)&.map { |match| match[0] }
end
end

auto_updates true

app "YouTube Music.app"

zap trash: [
"~/Library/Application Support/YouTube Music",
"~/Library/Preferences/com.github.th-ch.youtube-music.plist",
"~/Library/Saved Application State/com.github.th-ch.youtube-music.savecState",
]
end