This is an amateur coder's attempt to automate music discovery on Spotify by aggregating tastemaker preferences. Or in simpler words, find new music o

shijithpk / music-discovery

submited by
Style Pass
2021-06-22 07:00:02

This is an amateur coder's attempt to automate music discovery on Spotify by aggregating tastemaker preferences. Or in simpler words, find new music on Spotify by combining the choices of experts.

Essentially what I'm doing here is consolidating new music playlists from different publications and radio stations into a single playlist on Spotify.

CD into the directory and install the modules you'll need with pip install -r requirements.txt. I've made extensive use of the spotipy library to access the Spotify API.

Create Spotify credentials — You'll need to set up a developer account at Spotify, if you don't have one already. Then put your client id, client secret and redirect url into cred_spotify.py.

Choose playlists to aggregate — playlist_ids_full.csv has a list of Spotify playlists you can aggregate. Info on each playlist is available in the name and description. If you think you want to include a playlist, just put 'yes' against it in the INCLUDE column. And if you don't want to include it, just leave the cell under INCLUDE blank. 6 playlists (Pitchfork, Rolling Stone, KCRW from the US and Line of Best Fit, NME, BBC Radio 6 from the UK) have been pre-selected to give you some default choices to start with, but they can be un-selected.

Change the country code — You'll need to change one line in the script spotify_market = 'IN' and put in the two-letter ISO code for your country. (You can find the code from this list.) It's important for something called track relinking. Essentially, if a track on a playlist isn't licensed for your country, Spotify will find a version of the track that is licensed, so you'll have fewer unplayable tracks.

Leave a Comment
Related Posts