Merge branch 'zhaarey:main' into main

This commit is contained in:
itouakirai
2025-09-30 20:03:39 +08:00
committed by GitHub
3 changed files with 4 additions and 3 deletions

View File

@@ -44,7 +44,7 @@ Original script by Sorrow. Modified by me to include some fixes and improvements
1. Open [Apple Music](https://music.apple.com) and log in 1. Open [Apple Music](https://music.apple.com) and log in
2. Open the Developer tools, Click `Application -> Storage -> Cookies -> https://music.apple.com` 2. Open the Developer tools, Click `Application -> Storage -> Cookies -> https://music.apple.com`
3. Find the cookie named `media-user-token` and copy its value 3. Find the cookie named `media-user-token` and copy its value
4. Paste the cookie value obtained in step 3 into the config.yaml and save it 4. Paste the cookie value obtained in step 3 into the setting called "media-user-token" in config.yaml and save it
5. Start the script as usual 5. Start the script as usual
## Get translation and pronunciation lyrics (Beta) ## Get translation and pronunciation lyrics (Beta)

2
go.mod
View File

@@ -3,7 +3,6 @@ module main
go 1.23.1 go 1.23.1
require ( require (
github.com/Eyevinn/mp4ff v0.50.0 // indirect
github.com/aead/cmac v0.0.0-20160719120800-7af84192f0b1 github.com/aead/cmac v0.0.0-20160719120800-7af84192f0b1
github.com/grafov/m3u8 v0.11.1 github.com/grafov/m3u8 v0.11.1
github.com/schollz/progressbar/v3 v3.14.6 github.com/schollz/progressbar/v3 v3.14.6
@@ -13,6 +12,7 @@ require (
) )
require ( require (
github.com/Eyevinn/mp4ff v0.50.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/google/go-cmp v0.6.0 // indirect github.com/google/go-cmp v0.6.0 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect

View File

@@ -180,6 +180,7 @@ func getUrlArtistName(artistUrl string, token string) (string, string, error) {
req.Header.Set("Origin", "https://music.apple.com") req.Header.Set("Origin", "https://music.apple.com")
query := url.Values{} query := url.Values{}
query.Set("l", Config.Language) query.Set("l", Config.Language)
req.URL.RawQuery = query.Encode()
do, err := http.DefaultClient.Do(req) do, err := http.DefaultClient.Do(req)
if err != nil { if err != nil {
return "", "", err return "", "", err