$ show spotbye/SpotiFLAC
SpotiFLAC is a cross-platform desktop application (built with Wails v2) that enables users to download high-quality FLAC audio from streaming services (Tidal, Qobuz, Amazon Music, Deezer) by leveraging Spotify metadata. The user inputs a Spotify track, album, playlist, or artist URL; the backend fetches metadata via Spotify's internal GraphQL API using reverse-engineered TOTP authentication, resolves streaming URLs through Songlink/Songstats, then downloads from the chosen service. The app includes a comprehensive suite of audio processing tools: audio analysis (spectrogram, FFT), BPM/key detection (Essentia.js), format conversion, resampling, ReplayGain tagging, lyrics management (LRCLIB), metadata enrichment, and file management. The frontend is built with React 19, TypeScript, Tailwind CSS, and shadcn/ui components, communicating with the Go backend via Wails bindings. The backend handles persistent storage (BoltDB for queue, history, caches), FFmpeg integration, and community API sessions for Tidal/Qobuz/Amazon. The architecture is a monolith desktop app with a clear separation between frontend UI and backend services, but the backend modules are tightly coupled to the app's specific workflow. The app is open-source (MIT) with a Patreon funding model and has a large internationalization footprint (11 languages). Key entry points include the SearchBar for URL input, the download queue for batch processing, and various tool pages (Audio Analysis, Converter, Resampler, ReplayGain, File Manager, Lyrics Manager). External dependencies include Spotify's undocumented API, Tidal/Qobuz/Amazon community APIs, Songlink, LRCLIB, MusicBrainz, FFmpeg, and Essentia.js. The codebase demonstrates significant reverse-engineering effort but carries maintenance risks due to reliance on fragile third-party APIs and hardcoded secrets.
The LLM identified 4 files worth highlighting for reuse:
Implements a full Spotify client using reverse-engineered internal APIs. Generates anonymous access tokens via TOTP with a hardcoded secret, acquires client tokens, and executes GraphQL queries (with persisted query hashes) to fetch track, album, playlist, artist, and search metadata. This module is self-contained and could be extracted as a standalone library for accessing Spotify metadata without an official API key, though it requires maintaining the TOTP secret and query hashes.
Handles browser-based verification and session management for community-run API instances (Tidal, Qobuz, Amazon). Opens a local HTTP server, redirects the user to a verification URL, captures the callback, exchanges tokens, and signs subsequent requests with HMAC. Includes rate-limiting and cooldown logic. This pattern is reusable for any desktop app that needs to authenticate with third-party services via OAuth-like flows without a backend server.
A frontend audio analysis engine that parses FLAC metadata, decodes audio via Web Audio API or FFmpeg fallback, computes peak/RMS levels, performs FFT-based spectrum analysis, and renders spectrogram data. It is self-contained and could be extracted as a standalone library for browser-based audio analysis, demonstrating non-obvious skill in handling audio decoding and signal processing in the browser.
A React hook that orchestrates single and batch downloads with automatic fallback between streaming services (Tidal, Qobuz, Amazon, Deezer). Handles file existence checks, cooldown detection, post-processing (ReplayGain, m3u8 generation, logs), and progress tracking. The fallback chain pattern and state management are reusable for any multi-source download manager, though the hook is tightly coupled to the app's backend API.