I wanted to know which songs I've discovered in 2022 and added to my playlists that are actually from the year 2022. Therefore I made this small program.
A lot of "best of 202x" / "top 202x songs" / "best artists 202x" lists contain songs that might have received heavy airplay in 202x but are actually not even from 202x but probably 202x-1 or even earlier. This is totally fine. But for myself I wanted to find out which songs I have discovered in 2022 that are actually from 2022.
The program checks all playlists that contain the term YEAR_TO_CHHECK
,eg. "2022" and in all playlists that match this expression it looks for song that are actually from the year 2022 (or your desired year) and check if they have been added to your library (❤️ in Spotify). If both is true (in this example: song is from 2022 + you like it) it adds the songs to the specified playlist.
Update: in the latest version it is also possible to add songs to the playlist that are not added to your library (🤍 in spotify), use ENV variable ONLY_LOVED_SONGS
.
That's it.
Here are my playlists for 2022, 2021, 2020, 2019.
- Create a Spotify application to receive a client id and secret
- Create a new (empty) playlist for the songs to be stored in
- Have Go ready on your machine (I tested with Go 1.15.3+ and latest with 1.19.2)
- Adapt values in the
env
file and copy or rename it to.env
SPOTIFY_ID= #this is the spotify client ID you need. register your application here: https://developer.spotify.com/
SPOTIFY_SECRET= #this is the spotify client secret
PLAYLIST_ID= #playlist ID in a format like 4AJnjP36kH39gQhgZFL8Ff
TOKEN_FILE=mytoken.txt
LOG_FILE=log.txt
ONLY_LOVED_SONGS= # true if only songs that are added already to your library should be considered, false otherwise
YEAR_TO_CHECK=2022
-
Generate and store the token
make token
-
Run the program
make run
-
Check your playlist 🕺
make open-browser
If this command doesn't work, check the playlist manually either in the browser or in your Spotify client.
Feel free to open a PR or issue.
I'm happy to hear your feedback via @jetzlstorfer.