Automatically saves tracks from your Spotify Discover Weekly playlist into a permanent playlist, so you never lose them when it resets each Monday.
- Java 26
- A Spotify Developer app with the following redirect URI:
http://127.0.0.1:8080/login/oauth2/code/spotify
- Clone the repo
- Copy
.env.exampleto.envand fill in your Spotify credentials - Add the env vars to your run configuration (see
.env.example)
The app reads the following environment variables (wired through application.properties):
| Variable | Description |
|---|---|
SPOTIFY_CLIENT_ID |
Client ID from your Spotify Developer app. |
SPOTIFY_CLIENT_SECRET |
Client secret from your Spotify Developer app. |
TARGET_PLAYLIST_ID |
The Spotify playlist ID to copy Discover Weekly tracks into. Must be a playlist you own. |
The Discover Weekly playlist itself is discovered automatically from the authenticated user's library — no ID is required.
The OAuth flow requests the following scopes:
playlist-read-privateplaylist-modify-privateplaylist-modify-publicuser-library-read
./mvnw spring-boot:runThen visit http://127.0.0.1:8080.