Merge pull request #90 from odenmh/patch-1

Fix token extraction due to Apple Music website structure change
This commit is contained in:
ZHAAREY
2025-11-04 14:49:37 +08:00
committed by GitHub

View File

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