listenarr
Syncs your top artists from ListenBrainz to Lidarr automatically.
Tech Stack
ListenBrainz to Lidarr Artist Sync
A Python automation project that connects personal listening data to self-hosted music library management. It pulls top artists from ListenBrainz, filters them through configurable rules, checks for existing or excluded entries in Lidarr, and adds only the artists that qualify.
Overview
This project was designed to solve a simple but recurring problem: music discovery happens constantly, but library curation in self-hosted tools is usually manual and repetitive. By turning ListenBrainz activity into structured Lidarr import decisions, the project creates a workflow where a music library evolves based on actual listening habits rather than one-off searches or manual maintenance.
What the project does
- Fetches top artists from ListenBrainz using configurable time ranges such as week, month, quarter, year, and all time.
- Filters out artists below a minimum listen threshold before attempting any import.
- Checks Lidarr for artists that already exist in the library.
- Respects Lidarr exclusions unless configured otherwise.
- Adds valid new artists using selected quality profiles, metadata profiles, and root-folder settings.
- Uses retry logic with exponential backoff to improve resilience when API calls are unreliable.
Problem
Music listeners often discover new artists through daily listening, but self-hosted media libraries do not automatically reflect those preferences. This creates friction between discovery and collection management, especially for users who want their library to stay aligned with what they actually listen to.
Solution
The script acts as an automation bridge between ListenBrainz and Lidarr. Instead of manually searching for artists in Lidarr, the user can define a set of rules—such as time range, listen threshold, profile IDs, and whether excluded artists should be considered—and let the script decide which artists are worth adding.
Technical highlights
| Area | Details |
|---|---|
| Language | Python 3.8+ for lightweight scripting and portability. |
| APIs | ListenBrainz provides listening statistics, while Lidarr handles artist lookup and library additions. |
| Configuration | Environment variables define connection settings, thresholds, profile IDs, and sync behavior. |
| Reliability | Input validation, clear error messages, and retry logic help reduce silent failures. |
| Automation | The script can be run manually or scheduled through cron for recurring syncs. |
Why it matters
The strongest part of the project is not just automation, but personalization. It uses real listening behavior as a signal for library growth, which creates a more relevant and lower-maintenance music collection workflow.
For self-hosters and music enthusiasts, that means less repetitive admin work and a library that better reflects current taste over time.