mirror of
https://github.com/zhaarey/apple-music-alac-atmos-downloader.git
synced 2026-01-15 14:22:53 -03:00
Fix: Update GetToken function for new Apple Music URL
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
func GetToken() (string, error) {
|
||||
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
|
||||
}
|
||||
@@ -23,10 +23,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
|
||||
}
|
||||
@@ -47,3 +47,4 @@ func GetToken() (string, error) {
|
||||
|
||||
return token, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user