DEV Community

Cover image for Set up spin-that-dice in 10 minutes, no Spotify app needed to start
Christian Anderson
Christian Anderson

Posted on

Set up spin-that-dice in 10 minutes, no Spotify app needed to start

spin-that-dice is a party dice for music: tap the die, get a random track from one of 43 categories, it plays. It now has a step-by-step guide that GitHub runs on a fresh machine every week, so if a step breaks I find out before you do.

You can roll before you've set anything up

A fresh clone ships a 305-track starter crate covering 10 of the 43 categories, so the dice works with no Spotify app at all:

git clone https://github.com/casareanderson/spin-that-dice && cd spin-that-dice
python3 -m pip install requests
python3 spin.py
Enter fullscreen mode Exit fullscreen mode
spin-that-dice on 127.0.0.1:8770 - spotify, 43 categories, 305 tracks indexed
Enter fullscreen mode Exit fullscreen mode

Open localhost:8770 and tap. Playing the song needs Spotify Premium on that device. There's no free fallback since Spotify pulled 30-second previews in 2024.

The weekly setup check: tests, first run, a roll from the crate, the static export

That's the real check. It starts the server, rolls from the crate over HTTP (Al Green, as it happens), checks an unknown category and a ../ path are refused, and builds the static site.

Then fill the other 33 categories

Make a free Spotify app, paste the client id and secret into spin.env, restart. It tops up the thinnest categories in the background, at most 60 requests an hour. One thing the guide is loud about: Spotify's quota window re-arms while you're throttled. Keep hammering after a 429 and the wait grows back towards 24 hours. spin.py stops calling until Retry-After passes, so don't restart it in a loop.

Or skip Spotify entirely and point it at Navidrome or Jellyfin with SPIN_PROVIDER.

spin-that-dice on a tablet

The full guide covers running it as a service, putting it on a tablet's home screen and publishing a static copy: docs/SETUP.md.

What would you put on the dice? I'm always after better categories.


🤖 Drafted with AI assistance from my own homelab notes, logs and repos, then reviewed and edited before publishing.

Top comments (0)