The Itch
I have pressed the thumbs-up button on music for more than ten years. When I finally looked, my Liked Music playlist had 7,592 songs. My listening history went back to 2013, with more than 43,000 scrobbles. That is a better radio station than anything on the dial. But an app kept it locked up. That app shuffles badly and needs a signal. It also forgets everything I like about how I listen.
So I built my own station. Not a playlist, a station. It is one continuous broadcast that plays 24/7 at home. I can tune in from my terminal, my phone or a browser. It knows my taste well enough to feel like a DJ who pays attention.
Inside the lab it lives at radio.lab. For the public, there is a listen-only door at the end of this post.

The Shape of It
The whole thing runs in one small container on Farosh, the media-and-GPU node of the realm. I put it on the home connection on purpose, not on a cloud node. Music platforms are quick to challenge datacenter IPs.
YouTube Music likes ──► sync (every 3 h) ──► library on the NAS disk (Opus files + tags)
│
cliamp-server (broadcast, 192 kbps MP3, crossfades,
│ weighted shuffle)
▼
radio-api (now playing, history, lyrics, artists, discovery) ──► web player
│
scrobbler relay (counts only MY connections) ──► Last.fm
The broadcaster is cliamp-server, the open-source radio server from the cliamp project (a lovely terminal music player). It takes a folder of music and turns it into a shoutcast-style stream. VLC, phone radio apps and cliamp itself can tune into that stream. I wrote everything else: a sync job, a small API, a scrobbler and a web player.
Part 1: Getting the Songs
Listing the likes (the 1,000-song trap)
The first version used the “videos I’ve rated” endpoint of the YouTube Data API. It used a read-only OAuth token from my own API client. It found 273 songs. The endpoint stops at about a thousand items without a warning, and only some of those items are music.
The fix was to read the real Liked Music playlist, page by page. That returns the real list, newest first, in about 150 pages per run. This was lesson one of many. When an API returns a number that is suspiciously round or small, assume a cap before you assume you are done.
Downloading politely
The sync had 7,500 songs to fetch, so it works in batches:
- 400 songs per run, every three hours, with a random pause of three to nine seconds between downloads. The first catch-up took about two and a half days.
- Deduplication before downloading. The same song often exists as several uploads. Every track gets a normalized
artist|titlekey. The batch claims each key, so two uploads of the same song cannot both slip through. - A “not a bot?” detector. Sometimes the platform challenges downloads two runs in a row. Then I get a push notification, and the library does not stall in silence.
- Remembering the dead. At one point the library stayed frozen for days. Every batch tried the same 400 likes first, forever. Their videos were deleted or private. Now permanent failures go to an “unavailable” list. The sync checks that list again only after 30 days.
Quality, then better quality
Free streams go up to about 130 kbps Opus, which is decent. With a YouTube Music Premium session, the same songs are available at about 256 kbps. I did not download everything again at once. An upgrade pass uses the rest of each batch after the new likes:
- download the better version to a side folder,
- make sure it decodes and that its length is within three seconds of the old file,
- copy every tag, including embedded cover art,
- swap it in under the same file name, so play counts, weights and scrobble keys keep working.
Today 92% of the library is in the high-quality format. Songs that vanished from the platform keep their old copy forever.
Old uploads from the last music service
A few hundred songs were my own uploads from a music locker that closed long ago. They came back with no artist, only a title. A cleanup tool looked up each one. It accepted a match only with more evidence: the title, a length within four seconds, and the artist in my listening history or library.
The tool also ran a spectral check. An old 128 kbps MP3 has nothing above about 16 kHz. So a frequency cutoff below that marks a low-quality source that I should replace. The tool renamed 275 songs, removed 85 duplicates and replaced 9 with proper versions.
Part 2: Making It Sound Like a Station
DJ crossfades
Out of the box, songs hard-cut, with whatever silence the artist left at the end. I patched the feeder of the broadcaster:
- it holds back the last 8 seconds of the audio of each song,
- it trims near-silence at the start and end (with a cap, so it does not eat a quiet intro),
- it mixes the overlap with an equal-power curve (cosine out, sine in), so the middle does not dip in volume,
- and it moves the “now playing” change to the start of the overlap.
I tested it the nerdy way. I crossfaded a 440 Hz tone into an 880 Hz tone. Then I checked that both tones are at about 70% at the midpoint and that the gap is gone.
Shuffle that knows my favorites
True random shuffle over 6,000 songs feels oddly impersonal. I played some songs 300 times. They should come around more often than a song I liked once in 2016. Each song gets a weight from my Last.fm play count:
weight = 1 + log2(1 + plays)
The logarithm matters. A favorite plays more often, but it cannot take over the station. The shuffle picks at weighted random, with a no-repeat window of half the library (500 songs at most). The broadcaster reads the weights file again each time it changes. So the station keeps learning without restarts.
I once filed a bug report against myself: “it isn’t shuffling.” It was shuffling. But the broadcaster scans its folder only at startup, and at the first start there were only 19 songs. Now the sync restarts the broadcaster each time the library changes.
Genres that make sense
Platform tags say “Music” for everything. I tried bulk lookups through a tagging tool. The tool got rate-limited. It also thought my entire library was a single album and put one genre on all of it.
Now I ask Last.fm once for the top tags of each artist and cache them. I keep only tags from a whitelist, with aliases: “hip-hop” and “underground hip hop” both become Hip Hop. When Last.fm is wrong, a small overrides file wins. Last.fm has never heard of one local soul-rap duo, so that duo gets the genre I give it.
Part 3: Scrobbling Only When I’m Actually Listening
The station plays 24/7, often to nobody. If every song it played counted as a scrobble, my listening history would be fiction.
So there is a personal stream, which is a relay of the broadcast. It counts my open connections.
My listening time adds up only while at least one connection is open. A song scrobbles after half its length or after four minutes, whichever comes first (the rule of Last.fm itself). “Now playing” updates when the song changes. Failed submissions go into a queue for retry. My devices tune into the personal stream. Everyone else gets the plain broadcast, which never scrobbles.
Part 4: The Player
I wanted a player that I open for fun, not only a play button.

- Two themes: a daylight skin and a night skin, behind a switch with a little Triforce knob. It follows the system setting until I choose. It remembers my choice, with no flash on load.
- Now playing with cover art, a progress bar and a blurred artist backdrop that crossfades. It uses artist photos and album art, with a cache and a rate limit.
- Synced lyrics from LRCLIB, an open lyrics database. Lines highlight and scroll in time with the broadcast. When I play a song on demand, I can tap a line to jump to it.
- Recently played, a slim strip of the last ten songs. It survives restarts.
- Library stats: songs per genre and decade, top artists, the longest and oldest tracks. Every bar has a label, and table views give exact numbers.
- Listening history from Last.fm: plays per year since 2013, top artists of all time, my most-played likes.
- Artist drawers: tap any artist to see their songs in my library, a short bio and similar artists.
- “Blips”: a rotating line of trivia, such as an artist fact, a library milestone or a listening statistic.
Owner-only powers
A few features appear only for me, on my own network:
- Love: a heart that loves the current track on Last.fm.
- On demand: play any song from the library in the page. The station keeps broadcasting for everyone else.
- Discover: press the compass, and the page plays songs that I don’t have. It chains them from the song that was playing, with the similar tracks from Last.fm. Each new song seeds the next. An “up next” queue loads in the background. When I love a discovery, it goes into my likes, and the next sync adds it to the station for good.
- Official video: only the official music video of the artist. If there is none, an official visualizer, else nothing. No fan uploads, no lyric videos, no live versions. The video can play muted, in sync with the broadcast.
The proxy enforces these limits. The interface does not only hide them. The owner endpoints accept only requests that come through my internal reverse proxy. So the public page gets a polite “not allowed”, even if someone writes the request by hand.
Part 5: Listening Everywhere
- Terminal: cliamp starts on the station by default. A tiny wrapper makes bare
cliamptune in. A separate profile gives me a local library player for the same files, artist by artist. - Phone: any internet radio app that points at the personal stream.
- Browser: the player, on the lab network or through a private link when I am away.
Lessons From the Trenches
- Silent caps are the worst bugs. I got 273 songs, not 7,592. I got 19 songs, not 600. When a number looks small, look for the limit.
- A swallowed exception is a lie. After I added the love button, every artist link returned an error, and nothing went to the log.
A local variable named
artistshadowed theartist()function of the module for the whole request handler. Now I run a small checker for shadowed names before every deploy. - Unicode titles break file systems. Some song titles in fancy Unicode went over the 255-byte limit for file names. Now the output templates cap the artist and title by bytes, not characters.
- Crashed batches leave orphans. One sync died in the middle of a batch. It left 261 downloaded songs on disk that were not in the index. A repair script adopts orphans from their tags. When the count stalls, my first step is now “check for orphans”.
- Upgrade in place, keep the identity. I swapped files under the same name. So 3,600 quality upgrades broke nothing: not the weights, not the history, not the scrobbles.
Tune In
The station is on the air right now. It plays my likes with crossfades and the weighted shuffle. When you listen from here, it does not touch my scrobbles, and it records nothing about you.
- In a browser: radio.poexone.com/listen/
- In VLC or any internet-radio app:
https://radio.poexone.com/listen/stream
Expect a lot of hip hop and a surprising amount of reggae and country. There is some nu metal from my teenage years and the occasional Bollywood detour. One listener made this station for one listener, and you are welcome to sit in.
By the numbers: 5,938 songs · 1,677 artists · 483 hours · 47 GB · 43,700+ scrobbles since 2013 · 8-second crossfades · one very opinionated shuffle.