From 033c3624b7f3c618f0c0ebd79eccc3803a8b5119 Mon Sep 17 00:00:00 2001 From: itouakirai <85016486+itouakirai@users.noreply.github.com> Date: Tue, 4 Nov 2025 08:29:01 +0800 Subject: [PATCH] Update API endpoint and regex pattern in GetToken --- token.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/token.go b/token.go index 71cc2c6..918bd65 100644 --- a/token.go +++ b/token.go @@ -24,7 +24,7 @@ func GetToken() (string, error) { if token, ok := cache.Get("token"); ok { return token, nil } - req, err := http.NewRequest("GET", "https://beta.music.apple.com", nil) + req, err := http.NewRequest("GET", "https://music.apple.com", nil) if err != nil { return "", err } @@ -45,10 +45,10 @@ func GetToken() (string, error) { return "", err } - regex := regexp.MustCompile(`/assets/index-legacy-[^/]+\.js`) + regex := regexp.MustCompile(`/assets/index~[^/]+\.js`) indexJsUri := regex.FindString(string(body)) - req, err = http.NewRequest("GET", "https://beta.music.apple.com"+indexJsUri, nil) + req, err = http.NewRequest("GET", "https://music.apple.com"+indexJsUri, nil) if err != nil { return "", err }