A Go application with several tools to automatically manage your Spotify library. This includes a sorter to organize your "Liked Songs" by year and a remover to block specific artists from your playlists.
This project contains multiple tools.
-
Fetches All Liked Songs: Pages through your entire "Liked Songs" library.
-
Groups by Year Added: Sorts tracks into playlists based on the year you added them, not the track's release year (e.g., "Liked Songs (2025)").
-
Smart Playlist Updates: If a yearly playlist already exists, the tool intelligently clears and repopulates it, preserving the playlist's URL and followers.
-
Custom Cover Art: Includes a pluggable interface to generate and upload custom cover art for each yearly playlist.
-
Scans All Playlists: Checks all playlists you own for tracks by specific artists.
-
Removes Blocked Artists: Automatically removes any tracks from a configurable list of blocked artists.
-
Automated Cleanup: Ideal for running periodically to ensure your playlists stay free of artists you don't want to hear.
-
Go (version 1.21 or later)
-
A Spotify account
-
A registered application on the Spotify Developer Dashboard
-
Go to the Spotify Developer Dashboard and log in.
-
Click "Create app" and give it a name and description.
-
Note your Client ID and Client Secret.
-
Go to the app's "Settings".
-
In the Redirect URIs field, add http://localhost:3000/callback. This must match exactly.
-
Click "Save".
-
Clone this repository to your local machine.
-
Create a file named
.envin the root of the project. -
Add your Spotify credentials to the
.envfile like this:
SPOTIFY_CLIENT_ID=your_client_id
SPOTIFY_CLIENT_SECRET=your_client_secretNavigate to the project directory in your terminal and run:
go mod tidyThis project contains several tools, or "processors." You can choose which one to run by editing the main.go file.
Open main.go and comment/uncomment the desired processor.
Make sure the NewPlaylistSorter line is active and the NewArtistRemover line is commented out.
// main.go (example)
func main() {
// ... setup code ...
// Activate the Playlist Sorter
processor := processor.NewPlaylistSorter(client, logger, imgGen)
// Make sure the Artist Remover is commented out
// processor := processor.NewArtistRemover(client, logger, []string{"artist_id_1"})
processor.Run(context.Background())
}Comment out the sorter and activate the NewArtistRemover, adding the Spotify IDs of the artists you want to block.
// main.go (example)
func main() {
// ... setup code ...
// Make sure the Playlist Sorter is commented out
// processor := processor.NewPlaylistSorter(client, logger, imgGen)
// Activate the Artist Remover with a list of artist IDs
blockedArtists := []string{"spotify_artist_id_to_block"}
processor := processor.NewArtistRemover(client, logger, blockedArtists)
processor.Run(context.Background())
}You'll need to authorize the application.
- Run the app from your terminal:
go run cmd/main.go. - The console will print a URL. Copy it into your browser.
- Log in to Spotify and click "Agree" to grant permissions.
The application will save an authentication token so you don't have to log in again.