Make your own Hitster

I recently played the game Hitster for the first time with my family. It was super fun! It is a music timeline guessing game in which players in rounds get a card that is hidden, and a song is played.
Players must place the card correctly on a timeline based on when they think the song was released.
As more songs are added to the timeline, it becomes increasingly challenging to place new songs in their correct chronological position.
The back side of the card has a QR code, and somebody else scanned it and played the music. My first question was how this was licenced. But when I realized that the QR code just triggers playing the song in the Spotify app, and that the game master needs to have a valid Spotify account, I both understood how the licencing worked (since the game master has to pay for the music through Spotify) and I figured that I could make my own version to extend the game with arbitrary songs. Claude to the rescue!

I asked Claude (voice mode) to create a python script that accepted a Spotify playlist and make a sheet of two-sided cards with the QR code on one side and the artist, title and year on the other side. We went some back and forth, especially when I realized that Spotify in November 2024 removed the possibility to read the Spotify-created playlists through the API, but finally we made something that worked really well!

I didn't spend much time on the design, so it's rather plain. But it saves the cards to a two-sided pdf where they align nicely when printed, and can be cut to size with a pair of scissors.
Extract from two-page pdf with hitster cards on them

You need an API key for the Spotify API, which you can get here. Then the script is self-contained and can be run with uv run. Since I uploaded it to a gist (see below), you can even do uv run https://gist.githubusercontent.com/kristomi/776481c389a66941332c77468200aead/raw/hitster.py https://open.spotify.com/playlist/0knWJ4L8IDRgUukfqBtE1t\?si\=2c81f7cc1e244777, or replace the final part with your own playlist url (you have to make it public inside Spotify first).

The trick to get Spotify-created playlists to the game, is to make your own copy of the list (which is easy), and then paste that list's url in here.