A self-hosted web application for managing your music library with SpotiFLAC integration. Think of it as Lidarr, but specifically designed for high-quality FLAC downloads via SpotiFLAC.
-
Clone the repository
git clone https://github.com/NotLugozzi/Spotiflac-web cd spotiflac-autowatcher -
Configure environment
cp .env.example .env # Edit .env with your paths (Spotify API credentials are optional) -
Start the application
docker-compose up -d
-
Access the web interface
http://localhost:8080
-
Prerequisites
- Python 3.11+
- FFmpeg (for audio processing)
-
Install dependencies
python -m venv venv source venv/bin/activate pip install -r requirements.txt -
Configure environment
cp .env.example .env # Edit .env with your settings -
Run the application
DEBUG=true python -m app.main
| Variable | Description | Default |
|---|---|---|
SPOTIFY_CLIENT_ID |
Spotify API Client ID (optional) | (empty) |
SPOTIFY_CLIENT_SECRET |
Spotify API Client Secret (optional) | (empty) |
MUSIC_LIBRARY_PATH |
Path(s) to scan for existing music | /music |
DOWNLOAD_PATH |
Path for downloaded files | /downloads |
SPOTIFLAC_SERVICE |
Services to use (comma-separated) | tidal,qobuz,deezer |
SPOTIFLAC_FILENAME_FORMAT |
Output filename template | {artist}/{album}/{track_number} - {title} |
SCAN_INTERVAL_MINUTES |
Auto-scan interval | 60 |
AUTO_SCAN_ON_STARTUP |
Scan library on startup | true |
AUTH_USERNAME |
Basic auth username (optional) | |
AUTH_PASSWORD |
Basic auth password (optional) | |
SECRET_KEY |
Session secret key | replace the default string |
LOG_LEVEL |
Logging level | INFO |
Spotify API credentials are optional. Without them, you can still:
- Download music using Direct URL input (paste Spotify URLs directly)
- Manage your existing local music library
- Scan and organize your music files
With Spotify API credentials, you get:
- Automatic artist/album matching from your local library
- Search integration to find new music
- Metadata fetching (album art, release dates, etc.)
- Complete discography discovery for artists
To get credentials:
- Go to Spotify Developer Dashboard
- Log in with your Spotify account
- Click "Create app"
- Fill in the app name and description
- Copy the Client ID and Client Secret
- Add them to your
.envfile
| Volume | Purpose | Mount Point |
|---|---|---|
spotiflac_data |
Database persistence | /app/data |
| Your music library | Existing music files | /music (read-only) |
| Downloads folder | New downloads | /downloads |
your music library and the download folder can coexist in the same directory, if you want to avoid having to move or symlink things manually
The dashboard provides an overview of your library with:
- Statistics (artists, albums, owned, wanted)
- Active downloads with progress
- Recently added albums
- Quick actions (scan, search, settings)
- View all artists in your library
- Click an artist to see their full discography
- Sync with Spotify to discover missing albums
- Monitor artists for automatic downloads
- Browse all albums with filters (owned, wanted, missing)
- View album details with track listings
- Queue albums for download
- Mark albums as "wanted" for later
- View active download queue with progress
- Download history with retry options
- Real-time status updates
With Spotify API configured:
- Search your local library
- Search Spotify for new music
- Click "Download" on any search result
Without Spotify API (or anytime):
- Use the Direct URL Download section
- Paste any Spotify URL (album, track, artist, or playlist)
- Supports multiple URLs at once (one per line)
- URLs can be in any format:
https://open.spotify.com/album/xxxxxhttps://open.spotify.com/track/xxxxxhttps://open.spotify.com/artist/xxxxxhttps://open.spotify.com/playlist/xxxxxspotify:album:xxxxx(URI format)
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/library/stats |
Get library statistics |
| POST | /api/library/scan |
Start a library scan |
| GET | /api/library/scan/status |
Get current scan status |
| GET | /api/library/scan/history |
Get scan history |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/artists |
List all artists |
| GET | /api/artists/{id} |
Get artist details |
| GET | /api/artists/{id}/albums |
Get artist's albums |
| POST | /api/artists/{id}/sync |
Sync with Spotify |
| PATCH | /api/artists/{id} |
Update artist settings |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/albums |
List all albums |
| GET | /api/albums/{id} |
Get album details |
| PATCH | /api/albums/{id} |
Update album settings |
| POST | /api/albums/{id}/refresh |
Refresh from Spotify |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/downloads/queue |
Get download queue |
| GET | /api/downloads/history |
Get download history |
| POST | /api/downloads |
Add album to queue |
| DELETE | /api/downloads/{id} |
Cancel download |
| POST | /api/downloads/{id}/retry |
Retry failed download |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/search/artists?query= |
Search artists on Spotify |
| GET | /api/search/albums?query= |
Search albums on Spotify |
| GET | /api/search/library?query= |
Search local library |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/settings |
Get application settings |
| GET | /api/settings/status |
Get system status |
| GET | /api/events |
SSE stream for real-time updates |
| GET | /health |
Health check endpoint |
id: Primary keyname: Artist namespotify_id: Spotify artist IDspotify_url: Spotify URLimage_url: Artist imagegenres: JSON array of genresis_monitored: Auto-download new releaseslocal_path: Path to local files
id: Primary keyname: Album namespotify_id: Spotify album IDartist_id: Foreign key to artistalbum_type: album/single/compilationrelease_date: Release dateis_owned: In local libraryis_wanted: Marked for download
id: Primary keyname: Track namealbum_id: Foreign key to albumtrack_number: Track positionduration_ms: Duration in millisecondslocal_path: Path to local file
id: Primary keyalbum_id: Foreign key to albumstatus: pending/queued/downloading/completed/failed/cancelled - this is currently broken as the spotiflac library doesn't send any information about progress or statusprogress: Download progress (0-100)error_message: Error details if failed
spotiflac-autowatcher/
├── app/
│ ├── __init__.py
│ ├── main.py
│ ├── config.py
│ ├── database.py
│ ├── models.py
│ ├── routes/
│ │ ├── api.py
│ │ └── pages.py
│ ├── services/
│ │ ├── spotify_service.py
│ │ ├── library_scanner.py
│ │ ├── download_manager.py
│ │ └── metadata_service.py
│ └── templates/
│ ├── base.html
│ └── pages/
├── requirements.txt
├── Dockerfile
├── docker-compose.yml
├── .env.example
└── README.md
# Enable debug mode
DEBUG=true python -m app.mainpytest tests/Spotify API not connecting
- Verify your Client ID and Secret are correct
- Check that your app has the required permissions
- Ensure no firewall is blocking outgoing connections
SpotiFLAC downloads failing
- Verify SpotiFLAC is properly installed
- Check that the service credentials are configured in SpotiFLAC
- Try running SpotiFLAC manually to debug
Library scan not finding files
- Check that the music path is correctly mounted
- Verify file permissions allow reading
- Supported formats: FLAC, MP3, M4A, OGG, OPUS, WAV, AIFF
Database errors
- Ensure the data directory exists and is writable
- Check disk space availability
- Try deleting the database file to reset
# Docker logs
docker-compose logs -f spotiflac-autowatcher
# Log level can be adjusted via LOG_LEVEL environment variable- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- SpotiFLAC - The underlying download engine
- FastAPI - Modern Python web framework
- HTMX - High power tools for HTML
- Tailwind CSS - Utility-first CSS framework
- Inspired by Lidarr and other ARR applications
