Automated updating of Spotify playlist of artists with upcoming shows

3 minutes

Using the cmf.com’s list of upcoming shows, I created a Python script/class to crawl the list, find matches by band via Spotify’s API, and add songs to a playlist. It also updates a publicly available Google spreadsheet (in theory). I’m still improving it and working on a few things as I migrate and refactor code.

See the playlist and the spreadsheet.

Note on recent Spotify Web API changes

As of Dec. 2024, I will likely not be doing much more work on this as Spotify has made significant changes to the Web API as of late November 2024, unfortunately, and while this was just a project for fun, I was looking forward to playing around the the track features and audio analysis which I can no longer get. In fact, a lot of things changed that point to increased monetization efforts.

The Spotify API used to return genres for albums very recently, and I found that even if an artist didn’t have genres, sometimes the albums would which would make the playlist more accurate; however, it’s showing deprecated as of December 2024. In fact, a lot of things changed that point to increased monetization efforts. Alas, we’ve all seen it. Darn.

Any productionalized app that used the removed endpoints prior still have access, but new apps and any apps in dev mode do not. As I have not productionalized my app (I run the update so I am the only user), my app is in dev mode. Darn.

We’ve come a long way since Echo Nest, the only reason I started using Spotify since they were acquired in 2014, which again, check out this website/map and blog.

Spotify API-related Tasks

The API returns genres for some artists, and my matching “algorithm” if you can call it that isn’t very sophisticated right now, so adding an extra check for genre will help weed out stray songs. Though the seed genres list is more limited, the genres returned for artists seems to be more expansive.

For example, Exodus returns the below genres:

["death metal", "hard rock", "metal", "old school thrash", "speed metal", "thrash metal"],

The band Nile returns the below genres:

["brutal death metal", "death metal", "metal", "oriental metal", "south carolina metal", "technical death metal", "thrash metal"]

As a note, the above is is copied and pasted from the JSON returned from the Spotify API artists endpoint.

Some others include…

"crossover thrash", "death metal", "denver metal", "metal", "speed metal", "thrash metal"... "horror punk", "industrial metal"..."finnish melodeath", "finnish metal", "folk metal", "melodic death metal", "metal", "nordic folk metal", "power metal", "symphonic metal", "viking metal"..."avant-garde metal", "swiss metal"..."chaotic hardcore", "chicago hardcore", "grindcore", "powerviolence"

Maybe you can guess from the genres above which ones belong to Weekend Nachos, Ensiferum, Wednesday 13, and Zeal & Ardor.

? Output Formatting

So far I’m just saving the (publicly) visible output to Google Sheets, but I am running the script via my own web app (Dockerized Flask, MySQL), and the output is friendlier but still needs tweaking.