SpotifFLAC
Turns Spotify links into tagged FLAC files, skipping matching ISRCs and retagging filename matches that lack an ISRC tag (even with other tags present) when duration fits within 3 seconds.
source (opens in new tab)The problem
A lossless (audio compression that keeps every bit of the source) file is only as useful as its tags. Spotify already has the catalog: titles, artists, albums, release dates, and artwork, plus an ISRC (International Standard Recording Code, an ID for one specific sound recording) for each track. An ISRC names one recording no matter which service or file holds it, tying a Spotify track to a stream elsewhere and to a file already on disk.
SpotifFLAC takes a Spotify link, finds the same recording on Tidal or Qobuz by ISRC, and writes a tagged FLAC (a lossless audio file format) file into your library.
Architecture
SpotifFLAC is an Electron desktop app with a React 19 renderer and a TypeScript main process. It started as a fork of afkarxyz/SpotiFLAC by way of keypaa's fork, and has since replaced the original Go/Wails backend with the TypeScript main process. Input is a Spotify track, album, playlist, or artist link; an artist link expands to the full discography.
Before each download, SpotifFLAC reads the ISRC tag of every FLAC in the target folder and caches the result by file size and modification time. A matching ISRC means the track is skipped. If the expected filename already exists without an ISRC tag and its duration is within 3 seconds of the Spotify track, SpotifFLAC repairs the tags on a copy, checks the ISRC it wrote, and only then renames the copy over the original. Any other file at that name (different ISRC, unreadable tags, or no duration match) is reported as a conflict and left untouched.
Tagging replaces the FLAC Vorbis comment (FLAC's tag format: plain KEY=value text fields) block in a fixed field order: title,
artist, album, album artist, date, track number, total tracks, disc number,
and ISRC. Every metadata block outside comments and pictures, including STREAMINFO and SEEKTABLE (FLAC metadata blocks for stream properties and seek points),
stays as it was. SpotifFLAC drops all existing picture blocks before embedding
the new front cover, so covers don't pile up. Each rewrite goes to a temporary
file, gets flushed with fsync, and is renamed over the original.
Downloads embed the Spotify cover, upgraded to Spotify's largest image when that setting is on. The library verifier walks a folder of MP3, FLAC, and M4A files and checks each for embedded or sidecar cover art. For missing covers it tries an optional local Spotify database first, then iTunes, Deezer, and MusicBrainz in fixed priority order behind a cache, then Spotify search. It embeds what it finds into FLAC files or writes it as a sidecar JPEG.
A cleanup tool strips COMMENT and DESCRIPTION fields from FLAC and MP3
files, one file or a whole folder at a time. The audio analyzer reads
STREAMINFO, decodes the file with the bundled ffmpeg, and plots a spectrum
alongside peak level, RMS, and dynamic range. Its verdict only confirms a
valid FLAC stream; spotting a lossy file passed off as lossless is up to
whoever reads the spectrum. Spotify track, album, artist, and ISRC lookups and
resolved cover URLs sit in local SQLite caches, and iTunes and MusicBrainz
calls go through rate limiters (20 per minute and 1 per second).
Boundaries
SpotifFLAC is for personal use, and its README says so: respect copyright law and the streaming platforms' terms. Whether you may download a given track stays your responsibility. Spotify supplies metadata and never audio. Audio comes from Tidal through your own account (with an optional self-hosted instance as fallback) or from a self-hosted Qobuz instance.
Files, tags, caches, and settings stay on your machine, and there's no
application-owned backend. Tidal tokens are stored encrypted through
Electron's safeStorage when the OS supports it. Tag quality is capped by
Spotify's catalog, so obscure releases and regional editions still need
checking by hand.