Download Spotify tracks/albums with metadata via YouTube Music (Perfect for Jellyfin libraries!)
Project description
SpotifySaver 🎵✨
⚠️This repository is under a strong stage of development, expect constant changes. If you find any mistake or bug, please open an ISSUE.
All-in-one tool for downloading and organizing music with Spotify metadata for Jellyfin.
The app connects to the Spotify and YouTube Music APIs. The goal is to generate an .nfo XML file to complete the metadata required by Jellyfin when building music libraries.
Read this file in Spanish
🌟 Features
- ✅ Download audio from YouTube Music with Spotify metadata
- ✅ Synchronized lyrics (.lrc) from LRC Lib
- ✅ Generation of Jellyfin-compatible
.infofiles (Still some things to work on here! ⚠️) - ✅ Automatic folder structure (Artist/Album)
- ✅ Command-line interface (CLI)
- ✅ Playlist support
- ✅ API
- ✅ MP3 Conversion
- ✅ Support for multiple bitrates (128, 180, 220, etc.)
Requirements
- Python 3.8+
- FFmpeg
- Spotify Developer Account
# Installation with Poetry (recommended)
git clone https://github.com/gabrielbaute/spotify-saver.git
cd spotify-saver
poetry install
# Or with pip
pip install git+https://github.com/gabrielbaute/spotify-saver.git
⚠️ IMPORTANT: You must log in to your Spotify account as a developer, create an app, and obtain a "client id" and "client secret." You must place this information in an .env file in the project's root directory.
⚙️ Configuration
Once in your project directory, run:
spotifysaver init
This will create a local .env file with the environment variables that will be requested:
| Variable | Description | Default Value |
|---|---|---|
SPOTIFY_CLIENT_ID |
ID of the Spotify app you created | - |
SPOTIFY_CLIENT_SECRET |
Secret key generated for your Spotify app | - |
SPOTIFY_REDIRECT_URI |
Spotify API Validation URI | http://localhost:8888/callback |
SPOTIFYSAVER_OUTPUT_DIR |
Custom directory path (optional) | ./Music |
YTDLP_COOKIES_PATH |
Cookie file path (optional) | - |
API_PORT |
API server port (optional) | 8000 |
API_HOST |
Host for the API (optional) | 0.0.0.0 |
The variable YTDLP_COOKIES_PATH will indicate the location of the file with the Youtube Music cookies, in case we have problems with restrictions to yt-dlp, specifically it is for cases in which youtube blocks the app for "behaving like a bot" (which is not entirely false lol)
You can also check the .example.env file
📚 Documentation
We maintain a documentation with Deepwiki, which constantly tree the repository. You can consult it at all times.
The documentation for using the API, on the other hand, can be found in this same repository here: API Documentation
💻 Using the CLI
Available Commands
| Command | Description | Example |
|---|---|---|
init |
Configure environment variables | spotifysaver init" |
download [URL] |
Download track/album from Spotify | spotifysaver download "URL_SPOTIFY" |
inspect |
Shows Spotify metadata (album, playlist) | spotifysaver inspect "URL_SPOTIFY" |
show-log |
Shows the application log | spotifysaver show-log |
version |
Shows the installed version | spotifysaver version |
Download Options
| Option | Description | Accepted Values |
|---|---|---|
--lyrics |
Download synchronized lyrics (.lrc) | Flag (no value) |
--output DIR |
Output directory | Valid path |
--format FORMAT |
Audio format | m4a (default), mp3 |
--cover |
Saves the cover album in de directoy (.jpg) | Flag (no value) |
--nfo |
Generates a .nfo metadata file in the JellyFin format | Flag (no value) |
--explain |
Show score breakdown for each track without downloading (for error analysis) | Flag (no value) |
--dry-run |
Simulate download without saving files | Flag (no value) |
show-log Options
| Option | Description | Accepted Values |
|---|---|---|
--lines |
Number of log lines to display | --lines 25 --> int |
--level |
Filter by log level | INFO, WARNING, DEBUG, ERROR |
--path |
Displays the location of the log file | Flag (no value) |
💡 Usage Examples
# Set spotifysaver configuration
spotifysaver init
# Download album with synchronized lyrics
spotifysaver download "https://open.spotify.com/album/..." --lyrics
# Download album with album cover and metadata file
spotifysaver download "https://open.spotify.com/album/..." --nfo --cover
# Download song in MP3 format
spotifysaver download "https://open.spotify.com/track/..." --format mp3
Usage with API
To use the API, you need to have the API server running. You can start it with the following command:
# Start the API server
spotifysaver-api
The server will run at http://localhost:8000 by default. You can find the API documentation here, which describes the technical aspects and usage in detail.
🖥️ Web Interface (UI)
SpotifySaver now includes a modern web interface that makes it easy to download music without using the command line:
# Start the web interface (includes API server)
spotifysaver-ui
This will start both the API server and a web interface that you can access at http://localhost:3000. The web interface provides:
- Easy URL input: Simply paste any Spotify URL (track, album, or playlist)
- Full configuration: All download options available through an intuitive interface
- Real-time progress: Monitor download progress and see detailed logs
- Responsive design: Works on desktop and mobile devices
- Automatic browser opening: Opens your default browser automatically
Web Interface Features:
- ✅ URL validation for Spotify links
- ✅ Configurable audio format (M4A/MP3) and bitrate
- ✅ Toggle lyrics and NFO file generation
- ✅ Custom output directory
- ✅ Real-time download progress
- ✅ Activity log with timestamps
- ✅ Error handling and user feedback
Default Ports:
- Web Interface:
http://localhost:3000 - API Endpoint:
http://localhost:8000
📂 Output Structure
Music/
├── Artist/
│ ├── Album (Year)/
│ │ ├── 01 - Song.m4a
│ │ ├── 01 - Song.lrc
│ │ ├── album.nfo
│ │ └── cover.jpg
│ └── artist_info.nfo
🤝 Contributions
- Fork the project
- Create your branch (
git checkout -b feature/new-feature) - Commit your changes (
git commit -m 'Add awesome feature') - Push to the branch (
git push origin feature/new-feature) - Open a Pull Request
📄 License
MIT © TGabriel Baute
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spotifysaver-0.6.0.tar.gz.
File metadata
- Download URL: spotifysaver-0.6.0.tar.gz
- Upload date:
- Size: 50.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a93769f63937c759b8492124a3a5227372b63b4bbb746e3dfd5a737f7ac01b2
|
|
| MD5 |
e8745b4dc463b49f2e42851c09688cfa
|
|
| BLAKE2b-256 |
9c7cb911204104ef982097ba6ccd6fc2dab73d05eeec3ca41f29e56b48ab99a2
|
File details
Details for the file spotifysaver-0.6.0-py3-none-any.whl.
File metadata
- Download URL: spotifysaver-0.6.0-py3-none-any.whl
- Upload date:
- Size: 73.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4be9750f015c9e53dd0c4b0eb46339ebde1bce1b3c44212c7ccd7b945c5ded98
|
|
| MD5 |
bbc5dd9cfde98a7fe8166c3ef9f4d0a7
|
|
| BLAKE2b-256 |
92e9e70972af222d58f0cefe5c707f63a5f012fdfb260d0759a4e52a50d97f34
|