One Library, No Duplicates: Turning Spotify Playlists into a Self-Hosted Music Collection
The actual problem: playlists overlap, storage shouldn’t
Anyone who’s built more than one playlist has playlists that share songs. Download each playlist independently and you’re storing the same file multiple times; that adds up fast across a real music collection. Spotify Playlist Pipeline solves that with one rule: exactly one shared “all songs” folder is the only place a song actually lives, ever — every playlist is just a folder of symlinks pointing back into it.
What it does, step by step
Spotify’s own playlist track list is the source of truth for what should end up downloaded — not something scraped from download logs, which can lie. spotDL reads that public playlist metadata (no Spotify Premium or API key required) and downloads matching audio for every track into the shared folder; if a song’s already there from a different playlist, the downloader skips it rather than duplicating it. A comparison pass against the real track list determines exactly which files belong to this playlist versus which genuinely failed. Then a playlist-named folder of symlinks gets built pointing back at the shared library — before any of it goes live, the whole shared library gets a malware scan (ClamAV) and every new file gets confirmed as genuinely audio, not a mislabeled video, via ffprobe. Only then does it get registered as a real, browsable Plex playlist.
The Liked Songs trap
Spotify’s Liked Songs list doesn’t behave like a normal playlist for most external tools, spotDL included — pointing the pipeline straight at it causes problems downstream. The fix is simple once you know about it (copy Liked Songs into a real playlist first, use that URL instead), but it’s exactly the kind of platform-specific quirk that costs real debugging time the first time you hit it blind.
Why the verification step isn’t optional
I built the malware scan and audio-only check as a hard gate before Plex registration, not an afterthought — spotDL pulls matching audio from wherever it can find it (typically YouTube), not from Spotify’s own licensed streams, so this is closer to building a personal backup of music I already listen to than a guaranteed-clean download from a single trusted source. Verifying every new file before it’s trusted in the library is the difference between “convenient” and “convenient and safe.”
What it demonstrates
The single-shared-library-plus-symlinks pattern is a genuinely reusable piece of software design — the same shape (one canonical copy, many logical views into it via pointers) shows up constantly in real systems, from deduplicated storage to how a build system caches shared dependencies. Recognizing that shape and applying it to something as mundane as playlist management, plus treating verification as a gate rather than an afterthought, are both habits that transfer well past this one project.
Part of the Homelab AI Blueprints series — see all nine blueprints for building and operating a self-hosted, AI-agent-run home server.
