nyancod3r/plexify

By nyancod3r

Updated 4 months ago

A Spotify to Plex Synchronization and download for offline listening with SpotDL.

Image
API Management
1

3.2K

Info

I would suggest to run a container for each music folder/playlist you want to sync. Set the SECONDS_TO_WAIT on 3600 or more.

Please add a star if you find it useful.

Setup

To set up the application, you need to configure several environment variables:

SPOTIPY_CLIENT_ID: Your Spotify client ID. You can create one here.
SPOTIPY_CLIENT_SECRET: The client secret of your Spotify client ID.
SPOTIPY_PATH: The path of your music archive. SpotDL will download the tracks to this location under a folder named as the Spotify playlist.
PLEX_URL: The URL of your Plex server, e.g., http://plex:32400.
PLEX_TOKEN: Your Plex token. You can find it by following these instructions.
SPOTIFY_URIS: A comma-separated list of the Spotify URIs you want to import. You can specify either a user's URI to import all public playlists owned by the user, or a playlist URI to import a specific public playlist. For example: spotify:user:sonosplay,spotify:user:sonosplay:playlist:6nQjiSQhdf84s2AAxweRBv.
SECONDS_TO_WAIT: The number of seconds to wait between synchronizations.

The following URI's are supported:

A user's URI which will import all public playlists a user owns: spotify:user:sonosplay
A playlist URI which imports a specific playlist (must be public): spotify:user:sonosplay:playlist:6nQjiSQhdf84s2AAxweRBv

Playlists will only be created on Plex if your Plex instance has at least one of the songs. Only songs found on your Plex will be created in the Plex Playlilst

How to run

docker run \
-d \
--name plexify \
-e PUID=1000 \
-e PGID=1000 \
-e SPOTIPY_CLIENT_ID=[YOUR_ID] \
-e SPOTIPY_CLIENT_SECRET=[YOUR_SECRET] \
-e SPOTIPY_PATH=/music \
-v [ROOT_PATH_TO_MUSIC_ARCHIVE]:/music \
-e PLEX_URL=[YOUR_PLEXSERVER_URL:PORT] \
-e PLEX_TOKEN=[PLEX_TOKEN] \
-e SPOTIFY_URIS=[SPOTIFY_URI] \
-e SECONDS_TO_WAIT=3600 \
--restart unless-stopped \
nyancod3r/plexify:latest

GitHub

https://github.com/NyanCod3r/Plexify

Docker Pull Command

docker pull nyancod3r/plexify