A lightweight command-line tool that reads local .lrc files or automatically downloads synchronized lyrics from LRCLIB and embeds them directly into your audio files' metadata.
Perfect for use with Lidarr, Navidrome, Jellyfin, Plex, or any music player that reads embedded lyrics.
- Scans your audio files and reads their metadata (Artist, Title, Album, Duration).
- Looks for a local
.lrcsidecar file with the same name. If found, it embeds it directly to save time. - If no local file exists, searches for synchronized lyrics on LRCLIB. Falls back to plain lyrics when synced aren't available.
- Embeds the lyrics permanently into the file's
LYRICStag β no separate.lrcfiles needed.
Supports FLAC, MP3, OGG, M4A/AAC, OPUS, and more (powered by TagLib).
Anonymous requests work without configuration. For large libraries, register a server-side application in the LRCLIB developer portal and obtain an App ID and API key.
Create the credentials file outside the repository:
sudo install -d -m 700 /etc/synclyr2metadata
sudo touch /etc/synclyr2metadata/credentials
sudo chmod 600 /etc/synclyr2metadata/credentials
sudoedit /etc/synclyr2metadata/credentialsAdd the following lines, replacing the placeholders with your own credentials:
LRCLIB_APP_ID=YOUR_APP_ID
LRCLIB_API_KEY=YOUR_API_KEYThe credentials file and its directory must be accessible to the user running synclyr2metadata (including the Lidarr service user). Keep the file private and adjust ownership if Lidarr runs as a dedicated user.
The same variables can be supplied through the process environment instead. Environment variables override the corresponding values in the credentials file. For Docker, pass them securely to the Lidarr container, or mount the credentials file read-only at /etc/synclyr2metadata/credentials.
Never commit real credentials or expose them in logs. The program sends them only to the LRCLIB API over HTTPS.
- With an API key: sequential HTTP requests with a 250 ms delay after each response.
- Without an API key: a 1 second delay after each response.
- HTTP 429: global cooldown across worker threads, respecting
Retry-Afterand using bounded exponential backoff with jitter. If the limit persists, remaining requests are deferred until another run. - Existing embedded lyrics are skipped before making API requests unless
--forceis supplied. Temporary API failures are reported as errors, not missing lyrics.
Authenticated mode prints LRCLIB: authenticated mode (250ms delay) at startup.
The native integration handles AlbumDownload (release imports and upgrades) using the supplied track paths, and TrackRetag using the single retagged file. It skips existing lyrics and serializes Lidarr event executions with an adjacent lock file. Ensure the service user can write that lock file and the logs. TrackRetag requires Lidarr to write audio tags; it does not guarantee a notification for every manual import.
For a non-root service account, grant a dedicated group read access to the credentials without making them world-readable. For example, on a native Linux installation, replace SERVICE_USER with the account running the script:
sudo groupadd --system lrclib
sudo usermod -aG lrclib SERVICE_USER
sudo chgrp lrclib /etc/synclyr2metadata /etc/synclyr2metadata/credentials
sudo chmod 750 /etc/synclyr2metadata
sudo chmod 640 /etc/synclyr2metadata/credentialsIf the group already exists, skip its creation. Restart the affected service so it receives the supplementary group. The account also needs write access to audio metadata and the script's lock and log files. Never grant world-readable permissions to the credentials.
Auto-sync lyrics every time Lidarr imports a new album.
Only one file to deploy β the binary is fully static with zero runtime dependencies.
Most common setup (Hotio or LinuxServer images on Alpine Linux).
sudo apt install build-essential docker.io # host prerequisites
git clone https://github.com/newtonsart/synclyr2metadata.git
cd synclyr2metadata
makeBuilds a static binary (~8MB) inside an Alpine Docker container. No modifications to your
docker-compose.ymlneeded.
Copy the binary into your Lidarr container's config volume:
cp synclyr2metadata /path/to/lidarr/config/scripts/Replace
/path/to/lidarr/configwith your actual Lidarr config mount (e.g../configor/opt/media-stack/config/lidarr).
- Open Lidarr UI β Settings β Connect β + β Custom Script.
- Configure:
- Name:
Sync Lyrics - On Release Import: β
- On Upgrade: β
- On Track Retag: β
- Path:
/config/scripts/synclyr2metadata
- Name:
- Click Test, then Save.
Logs are automatically generated in the same folder:
/config/scripts/synclyr2metadata.log(General execution log)/config/scripts/synclyr2metadata_plain.log(Tracks that only got plain/unsynced lyrics)/config/scripts/synclyr2metadata_missing.log(Tracks that couldn't be found on LRCLIB)---
For bare-metal or systemd-based Lidarr installations.
# Debian / Ubuntu
sudo apt install build-essential libcurl4-openssl-dev libtag1-dev
# Arch
sudo pacman -S base-devel curl taglib
# Then build
git clone https://github.com/newtonsart/synclyr2metadata.git
cd synclyr2metadata
make nativesudo make install # installs to /usr/local/binOr copy manually to a directory Lidarr can access:
cp synclyr2metadata /path/to/lidarr/scripts/- Open Lidarr UI β Settings β Connect β + β Custom Script.
- Configure:
- Name:
Sync Lyrics - On Release Import: β
- On Upgrade: β
- On Track Retag: β
- Path:
/path/to/synclyr2metadata
- Name:
- Click Test, then Save.
Logs are automatically generated in the same folder as the binary:
synclyr2metadata.logsynclyr2metadata_plain.logsynclyr2metadata_missing.log
You can also use synclyr2metadata directly from the command line:
# Sync a flat folder of audio files
./synclyr2metadata --folder "/path/to/downloaded_tracks"
# Sync a single album
./synclyr2metadata --album "/path/to/Artist/Album (2024)"
# Sync all albums from an artist
./synclyr2metadata --artist "/path/to/Artist" --threads 8
# Sync your entire library (Artist/Album structure)
./synclyr2metadata --library "/path/to/music" --threads 4
# Export paths of tracks that only got plain lyrics and tracks with missing lyrics
./synclyr2metadata --library "/path/to/music" --out-plain ./plain.txt --out-missing ./missing.txt
# Sync a directory and delete original .lrc sidecar files after embedding them
./synclyr2metadata --album "/path/to/downloaded_album" --clean-lrc| Option | Description |
|---|---|
--folder PATH |
Sync audio files directly in one folder, without requiring Artist/Album layout |
--album PATH |
Sync lyrics for a single album directory |
--artist PATH |
Sync all albums under an artist directory |
--library PATH |
Sync entire library (artist/album structure) |
--out-plain FILE |
Write paths of tracks falling back to unsynced lyrics to file |
--out-missing FILE |
Write paths of tracks not found on LRCLIB to file |
--force |
Overwrite existing embedded lyrics |
--clean-lrc |
Delete local .lrc file after successfully embedding it |
--threads N |
Parallel download threads (default: 4, max: 16) |
--help |
Show help |
If make native fails with fatal error: taglib/tag_c.h: No such file or directory,
install the native development dependencies first:
# Debian / Ubuntu
sudo apt install build-essential libcurl4-openssl-dev libtag1-dev
# Arch
sudo pacman -S base-devel curl taglibThe default make target builds in Docker and vendors/builds TagLib inside the
container, so these packages are only needed for make native.
βββ MF DOOM βββ
βΆ MM.FOOD (2004) (26 tracks)
[ 1/26] Beef Rapp β synced
[ 2/26] Hoe Cakes β plain
[ 3/26] Potholderz β already has lyrics
[ 4/26] Unreleased Track β not found
ββββββββββββββββββββββββββββββββββββββββββββββ
β Synced: 22
β Plain: 1
β Skipped: 1
β Not found: 2
ββββββββββββββββββββββββββββββββββββββββββββββ