add lrc file

pull/14/head
itouakirai 5 months ago committed by GitHub
parent d6c7b404ae
commit fc373764ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      main.go

@ -1110,6 +1110,7 @@ func rip(albumId string, token string, storefront string, userToken string) erro
continue
}
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)
var lrc string = ""
if userToken != "" {
@ -1120,6 +1121,11 @@ func rip(albumId string, token string, storefront string, userToken string) erro
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")
}
}
}
}

Loading…
Cancel
Save