evilgenius.id
Lab

TinyTube: a YouTube that only plays channels I approve

A YouTube-style app for a toddler. Allowlist-only channels, card images taken from the video itself, and a score that suggests which channels to add or block.

Open evilgenius.id/tinytube

My toddler loves dinosaurs, robots and space, and YouTube knows it. A few dinosaur videos in, autoplay can land on a fast toy unboxing with an adult shouting over it. I wanted a feed where only channels I approved can show up, at a calm pace, with no exits to the rest of YouTube.

TinyTube home grid. Blue bezel is Education, amber is Light watch

Where the idea came from

I took apart hackertube.org first, a YouTube-style video site. It is a static single-page app that reads a precomputed feed from a small JSON API, with a seed, a list of seen videos and an offset. Nothing is picked at view time. That shape fits a toddler app: all the choosing happens offline, where I can review it, and the tablet only plays the result.

What it does

  • Shows videos only from channels I approved. No search, no comments, no suggestions from outside the list.
  • Mixes Education and Light watch 1:1. A video watched recently doesn’t come back in the next 100 cards.
  • Skips Shorts, live streams and anything under 1 minute or over 60.
  • Plays through YouTube’s no-cookie embed under a clear layer that eats every tap, so the logo, title and end screens can’t be clicked. When a video ends, a grid of other approved videos shows under it.
  • Settings sit behind a 3-second press on a faint gear and a PIN. The PIN is asked each time and never saved on the tablet.
  • Installs to the tablet home screen and runs full screen.

Player with the big back button and the up-next grid

Architecture

Three parts, no framework and no build step:

  • A Cloudflare Worker (worker.mjs) serves the app and its API under /tinytube/, checks the parent PIN, and runs a cron tick every minute. The tick starts a refresh when one is due: after I approve a channel, when frames are left over, or 24 h after the last one.
  • D1 holds everything: channels, videos and suggestions as JSON blobs, plus the frame JPEGs.
  • The tablet app is a PWA in plain JS. It asks for a feed, shows the cards and plays videos. Watch history stays on the device.

All the choosing happens in the refresh. By the time the tablet asks, the feed is just a read.

Data flow: parent approval, uploads from the Data API, card frames from the watch page or the hq2.jpg fallback, channel scoring back to the parent, all stored in D1, then feed, card grid and locked player on the tablet

Card images from the video, not the uploader

A YouTube thumbnail is an ad. Uploaders A/B test them for clicks, which is how a calm video ends up with a screaming face on it. TinyTube never shows it.

Instead it reads the “most replayed” heatmap from the watch page: 100 markers with a replay score each. It takes the peak, skips the intro (the peak is often at 0 seconds), and finds that moment in YouTube’s storyboard, the sprite sheet of small frames used for seek previews. The server saves the one sheet it needs, and the app crops the right cell with CSS. About half of kids videos have no heatmap. Those get a frame from the middle.

Finding channels

Approving channels one by one doesn’t scale, so TinyTube looks at who my approved channels link to, in their featured channels and video descriptions.

  • +1 for each link from an approved channel.
  • −1.5 for each link from a blocked channel. A bad neighbour counts more than a good one.
  • Penalties for words in the channel and its last 10 titles: surprise eggs, prank, challenge, ASMR, and consumerism (haul, shopping, giveaway, rich vs poor, “buying every”). I added consumerism to the list partway through the build.
  • A small bonus for calm markers like preschool, phonics, counting and storytime.

A channel linked from at least 2 approved channels, with no warnings and no links to blocked ones, is approved on its own, 5 per refresh at most. Those can’t approve further channels, so one bad pick can’t snowball. Weaker matches wait for one tap from me. What the score can’t see is an adult voice-over or fast cutting. For that, my review is still the filter.

From my Mac to Cloudflare

The first version was a Node server on my Mac with JSON files. To run it without my Mac I moved it into a Cloudflare Worker at evilgenius.id/tinytube/, with data in D1 and a cron tick every minute that runs the refresh in small batches.

Two walls:

  • CPU. The Free plan gives a Worker 10 ms of CPU per request. Parsing one YouTube watch page takes more than that. Moving to Workers Paid fixed it.
  • Google blocks Cloudflare. From Cloudflare’s IPs, Google answers most watch-page requests with a 429 CAPTCHA page. No page means no heatmap and no storyboard. The fallback is hq2.jpg, a mid-video frame YouTube makes on its own. It is not the uploader’s pick, so the rule holds, but it is not the most-replayed moment either.

In the live feed today, 10 of 36 cards show the replay peak, 9 a storyboard frame from the middle, and 17 the hq2.jpg fallback.

How it was built

I didn’t write the code. I wrote the brief, answered questions, tested on the tablet and said no until it worked. All of it happened on 3 November.

  • Brief. One paragraph: a YouTube lookalike “modeled on hackertube.org’s architecture”, the channels I wanted, the channels to repel, and the rule that cards never show the uploader’s thumbnail.
  • Spec before code. I ran it through Spec Kit: a spec with user stories and acceptance tests, a plan, a research file where every YouTube data source was checked live, and a list of 30 tasks. The research step is where the heatmap and storyboard formats were confirmed, and where it found that about half of kids videos have no heatmap.
  • First build. A Node server with no dependencies and 20 checks for feed balance, frame math and discovery scoring. First commit at 09:15.
  • Parallel sessions. Playback settings and the kid theme were built in their own Claude sessions on their own branches, then merged. The Cloudflare port ran in the main session.
  • Testing on the tablet. Each round on the tablet turned into a commit: the up-next grid, parent tools under the player, a QA pass for the phone layout. Last commit at 11:55.

Decisions

Call What
Go Allowlist only. No search.
Go Education and Light watch mixed 1:1.
Go Card image from the most-replayed moment, mid-video frame as fallback.
Go Consumerism as a block signal, added partway through the build.
Go Auto-approve, capped at 5 per refresh, and auto-approved channels can’t approve others.
Go Country preference (ID, US, GB) in discovery.
Go Workers Paid, because 10 ms of CPU can’t parse a watch page.
Go YouTube’s hq2.jpg when Google blocks the watch page.
Kill The uploader’s thumbnail.
Kill Downloading videos with yt-dlp and finding frames with ffmpeg. Too heavy, and a grey area under YouTube’s terms.
Kill A video quality setting. YouTube ignores the request in its embed.
Kill Saving the PIN on the tablet.

What’s still open

  • Heatmap and storyboard data come from YouTube’s undocumented watch page. When it changes, new frames stop until I update the parser.
  • Most new frames are now the fallback. Getting replay peaks back means fetching watch pages from somewhere Google doesn’t block.
  • iOS sometimes blocks autoplay, so the first tap goes to YouTube’s play button.
  • It is built for one family. One D1 table of JSON blobs is fine for that and wrong for more.