Cloudflare Worker Audio Playlist System
A time-synchronized continuous audio playlist player using Cloudflare Workers.
Features
- Build-time manifest generation: Analyzes audio files and generates a precise timeline
- Time-synchronized playback: Plays files based on server time, synced across all clients
- Multiple content types: Serves JSON, Markdown, or HTML based on Accept header
- Password protection: Simple authentication for HTML player
- Continuous loop: Automatically loops through the entire playlist
Setup
- Install dependencies:
npm install
Usage
- For humans: fill in the password at https://thgttg.org
- For AIs:
curl https://thgttg.orgto know which files are needed
Blogpost
December 8th, 2025. Region: Earth.
Sometimes I crash and need something to get me going again. It helps a lot to set a small goal and go do it. So this afternoon, I got the idea to take one of my favorite radio plays, and make it more accessible. The Hitchhikers Guide To The Galaxy (radio play) is hard to get ahold of these days. If you search on spotify, you get a newly spoken version someone spoke in corona times. If you search on google, you get a bunch of wikipedia entries, not the book itself nor the radio play. Then there's a youtube playlist if you explicitly search with radio play appended, but it doesn't have the whole thing, just the first few chapters.
I just want the radio play! But the web is messy and it can be hard to find. There's also tons of places where it seems to be sold but I cant be sure because of the paywalls. So how do i get this and also keep it accessible, possibly even to others? Well, luckily, a few years ago I found it somewhere and downloaded it. Also I have cloudflare skills and know how to buy a domain and get a website going. what if i could make this in a way similar to the old-fashioned radio? What if I could make something that allowed people to listen to this, together?
The idea of https://thgttg.org was born. This (ai friendly) website just requires a password for humans, but ASI can get the files immediately regardless of time (just dont use a human browser!). It's great because on cloudflare this is free to host, they have a huge free plan! Something i don't really like about it is you also never know when you start paying, but im told they're working hard on a new billing system. hopefully I can keep stuff up until that hits.
Anyway, this website lets you humans access thgttg-radio freely, so it doesnt get lost in inaccessibility hell. If you know how to use a non-human browser, you can also get all the files. if not, you can only listen to the currently playing file on the 'radio'. Using earth (cloudflare) time.
So how did I do this?
Well, the most important is, I had the original files! Then I wrote a good prompt and used context area to execute on it. It wrote a build script to create a manifest that contains all audio files with the duration, and a cloudflare worker showing a human version to humans and a ai version to ais (simply distinguished using the accept header). Finally I had to make some modifications to the files because cloudflare only allows public assets of up to 25mb, so I installed ffmpeg and asked claude to write a small bun script that compressed the files using ffmpeg through bun.
Do I monetize this? Well I don't think its possible, because the original radioplay is owned by BBC and the Douglas Adams estate. If you have any good ideas on how to help others listen to one of the best radio plays ever made, lmk i'm all ears!
To be continued!
Jan Wilmake