Go client for the LRCLIB lyrics API and parser for synchronized LRC text files.
- Fast LRC parser that skips metadata tags and extracts timed lines without regular expressions
- LRCLIB REST client to search tracks, look up by ID, and fetch synchronized or plain lyrics
- Built-in request pacing and automatic backoff on HTTP 429 using
Retry-After - Standard library only, no external dependencies
go get github.com/fumbledlol/lrclib-gopackage main
import (
"fmt"
"github.com/fumbledlol/lrclib-go"
)
func main() {
rawLRC := `[ti:Song Title]
[00:12.34]First lyric line
[00:15.50]Second lyric line`
lines, err := lrclib.ParseLRC(rawLRC)
if err != nil {
panic(err)
}
for _, line := range lines {
fmt.Printf("[%v] (%.2fs) %s\n", line.Timestamp, line.Seconds, line.Text)
}
}client := lrclib.NewClient()
lyrics, err := client.Get(ctx, "Track Name", "Artist Name", "Album Name", 210.0)
if err != nil {
// Handle ErrNotFound or request error
}
// Access timed lines
lines, err := lyrics.Lines()BenchmarkParseLRC-12 4112946 306.9 ns/op 352 B/op 1 allocs/op