add lrc file

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

@ -1146,6 +1146,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 != "" {
@ -1156,6 +1157,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