Module lrclib

Source
Expand description

Asking LRCLIB for the words, and reading what it answers.

No socket here, exactly as in crate::musicbrainz: this builds addresses and reads answers. Waiting between requests belongs to the optional HTTP client, available with the fetch feature. This module can therefore be tested against canned text without network access.

§Why this service and not another

Lyrics are the composition’s copyright, and owning a FLAC grants no rights in it — they are legally a different object from the recording. Of the free sources, LRCLIB is the only one an open-source program can query without breaking an API’s own terms: Genius forbids the scraping its lyrics require, and Musixmatch’s free tier is non-commercial and truncated. The reasoning in full is in docs/design/lyrics.md.

It is also the gentlest network path this program has. No key, no account, a JSON document of a few fields, and a failure that costs nothing: no lyrics is not a broken catalog, where a bad MusicBrainz match attaches the wrong record to an album.

§Identify yourself

LRCLIB drops connections from agents it has come to distrust — Jellyfin’s server agent is refused outright, with no status code at all, the connection simply closing. This program sends the same honest User-Agent it sends MusicBrainz, and shares its throttle: being slower than a free service requires is never the wrong mistake.

Structs§

Words
The words themselves.

Enums§

Found
What the service had for one track.

Constants§

WEB_SERVICE
Where the service lives.

Functions§

get_url
The address that asks about one track.
read
Reads what the service answered.
read_checked
Reads a service response, refusing missing or wrongly typed answer fields.