Fix token extraction due to Apple Music website structure change

This commit is contained in:
odenmh
2025-11-04 00:41:56 +03:00
committed by GitHub
parent f430835e03
commit b2d3326905

View File

@@ -23,7 +23,7 @@ func GetToken() (string, error) {
return "", err
}
regex := regexp.MustCompile(`/assets/index-legacy-[^/]+\.js`)
regex := regexp.MustCompile(`/assets/index-legacy~[^"'\s]+\.js`)
indexJsUri := regex.FindString(string(body))
req, err = http.NewRequest("GET", "https://beta.music.apple.com"+indexJsUri, nil)
@@ -47,3 +47,4 @@ func GetToken() (string, error) {
return token, nil
}