add lrc file
This commit is contained in:
parent
d6c7b404ae
commit
fc373764ed
6
main.go
6
main.go
@ -1110,6 +1110,7 @@ func rip(albumId string, token string, storefront string, userToken string) erro
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
filename := fmt.Sprintf("%02d. %s.m4a", trackNum, forbiddenNames.ReplaceAllString(track.Attributes.Name, "_"))
|
filename := fmt.Sprintf("%02d. %s.m4a", trackNum, forbiddenNames.ReplaceAllString(track.Attributes.Name, "_"))
|
||||||
|
lrcFilename := fmt.Sprintf("%02d. %s.lrc", trackNum, forbiddenNames.ReplaceAllString(track.Attributes.Name, "_"))
|
||||||
trackPath := filepath.Join(sanAlbumFolder, filename)
|
trackPath := filepath.Join(sanAlbumFolder, filename)
|
||||||
var lrc string = ""
|
var lrc string = ""
|
||||||
if userToken != "" {
|
if userToken != "" {
|
||||||
@ -1120,6 +1121,11 @@ func rip(albumId string, token string, storefront string, userToken string) erro
|
|||||||
lrc, err = conventTTMLToLRC(ttml)
|
lrc, err = conventTTMLToLRC(ttml)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("Failed to parse lyrics: %s \n", err)
|
fmt.Printf("Failed to parse lyrics: %s \n", err)
|
||||||
|
} else {
|
||||||
|
err := writeLyrics(sanAlbumFolder, lrcFilename, lrc)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("Failed to write lyrics")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user