|
|
|
@ -1127,19 +1127,16 @@ func rip(albumId string, token string, storefront string, userToken string) erro |
|
|
|
|
oktrackNum += 1 |
|
|
|
|
continue |
|
|
|
|
} |
|
|
|
|
var lrc string = "" |
|
|
|
|
if userToken != "" { |
|
|
|
|
ttml, err := getSongLyrics(track.ID, storefront, token, userToken) |
|
|
|
|
if err != nil { |
|
|
|
|
fmt.Println("Failed to get lyrics") |
|
|
|
|
} else { |
|
|
|
|
lrc, err := conventTTMLToLRC(ttml) |
|
|
|
|
lrc, err = conventTTMLToLRC(ttml) |
|
|
|
|
if err != nil { |
|
|
|
|
fmt.Printf("Failed to parse lyrics: %s \n", err) |
|
|
|
|
} else { |
|
|
|
|
err := writeLyrics(sanAlbumFolder, lrcFilename, lrc) |
|
|
|
|
if err != nil { |
|
|
|
|
fmt.Printf("Failed to write lyrics") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1174,6 +1171,9 @@ func rip(albumId string, token string, storefront string, userToken string) erro |
|
|
|
|
index := trackNum - 1 |
|
|
|
|
tags := []string{ |
|
|
|
|
"tool=", |
|
|
|
|
fmt.Sprintf("lyrics=%s", lrc), |
|
|
|
|
fmt.Sprintf("cover=%s/cover.jpg", sanAlbumFolder), |
|
|
|
|
fmt.Sprintf("album=%s", meta.Data[0].Attributes.Name), |
|
|
|
|
fmt.Sprintf("title=%s", meta.Data[0].Relationships.Tracks.Data[index].Attributes.Name), |
|
|
|
|
fmt.Sprintf("album=%s", meta.Data[0].Attributes.Name), |
|
|
|
|
fmt.Sprintf("artist=%s", meta.Data[0].Relationships.Tracks.Data[index].Attributes.ArtistName), |
|
|
|
|