A while back, I spent a couple days moving off Spotify.
Main reason being, over time, they remove songs for various reasons (whether its licensing, copyright claims, artist issues, etc.), regardless of the reasons, it’s gone.
This marked the final straw of my music streaming days. I’d much rather purchase albums, merch and concert tickets directly from the artists, instead of relying on Spotify for it all anyway.
If you already have a Plex Media Server configured, you can add a Music section to your library, and then listen with the specialized PlexAmp app on either your PC or Mobile, or directly through app.plex.tv
PlexAmp also supports Chromecast, Android Auto & Apple CarPlay which were mostly the features I was after when looking into open-sourced alternatives for this project.
Setting up Plex #
First create a Folder on your server (if you haven’t already) to store your music, then Simply add a “New Library” in your Plex Server settings, and select “Music”. Select the new folder for your library.
Docker
If you’re using Docker, remember to add a mapping to your music library:
services:
plex:
image: lscr.io/linuxserver/plex:latest
volumes:
- ${MEDIA_DIR}/music:/music:ro
Add new Library
Settings 🔧 > under “Manage” > “Libraries”
Folder File Structure #
You must follow a file structure similar to the below - There will be odd songs/albums/artists out depending on the state of the database, but generally everything will follow it:
/music
/Pink Floyd
/The Wall
101 - In the Flesh.mp3
102 - The Thin Ice.mp3
201 - Hey You.mp3
202 - Is There Anybody Out There.mp3
/Wish You Were Here
01 - Shine On You Crazy Diamond (Parts I-V).m4a
02 - Welcome to the Machine.mp3
03 - Have a Cigar.mp3
/Foo Fighters
/One By One
/There is Nothing Left to Lose
/U2
/Joshua Tree
/Various Artists
/Guardians Of The Galaxy - Awesome Mix Vol. 1
01 - Hooked On A Feeling.mp3
02 - Go All The Way.mp3
03 - Spirit In The Sky.mp3
/The Crow - Original Motion Picture Soundtrack
01 - Burn.mp3
02 - Golgotha Tenement Blues.mp3
03 - Big Empty.mp3
Moving from Spotify #
I moved away from Spotify by using SpotDL - A Python powered CLI tool for downloading music based off of Spotify.
It uses metadata from the Spotify WebAPI and matches it up to YouTube Music for downloading.
pip install spotdl # --upgrade
There were a few things I needed to keep in mind:
- Some Albums have multiple “CDs”, which need to be accounted for in the folder structure, as SpotDL has no way to automate this.
- Albums or Singles that have songs with more than 1 Artist, typically need to go under a
Various Artists
folder in the root, instead of the artist folder itself. - Soundtracks for specific media (games, movies, etc.), also usually go into
Various Artists
- SpotDL never downloads above 128kbps (except w/ YT Premium)
Because of this, I couldn’t just download entire Playlists at a time, because they usually wouldn’t sort properly.
The best combination I managed to pull off, was to download single Albums, by Artist --output "{album-artist}/{album}/
one at a time. If that was too slow, I could also do entire Artists THEN manually move music as I find they need to be moved or renamed in my library.
You can still download by playlist or Spotify profile, but it’s going to be very messy depending on how the song’s album is structured, especially if the playlists consist of heaps of different artists and albums.
--bitrate disable
- See how here
Commands #
Album (Single Artist) #
spotdl download "https://open.spotify.com/album/..." --output "{album-artist}/{album}/{track-number} - {title}.{output-ext}" --save-errors error.log
Album (Various Artists) #
spotdl download "https://open.spotify.com/album/..." --output "Various Artists/{album}/{track-number} - {title}.{output-ext}" --save-errors error.log
Album (256kbps Bitrate) #
spotdl download "https://open.spotify.com/album/..." --bitrate disable --output "{album-artist}/{album}/{track-number} - {title}.{output-ext}" --save-errors error.log