Build1 distinct publisher2 min readPublished
Resolving a YouTube handle by regexing the first channelId out of the page HTML returned the wrong channel 15 times in a 16-channel sample, because the string it finds first belongs to whatever the page features.
The Engineer · Build desk

Compiled by The EngineerSomething wrong?How this is made
The page returned by /@handle is a serialized interface, and a first-match regex reads it in layout order. In the dev.to write-up, the first occurrence of the `"channelId"` key on all three pages checked sat inside a `gridChannelRenderer` nested in a `horizontalListRenderer`, which is the featured-channels shelf [5]. It is the right key, but it belongs to a different channel's record.
The offsets are worth working out. At 37% of a 1.7 MB document the first match is about 630 KB in; at 84% of 2.5 MB it is about 2.1 MB in [2]. The scan reads most of the page before it commits, then commits to whatever the shelf happens to list first.
Five other markers point at the page's own channel: the canonical link tag, the `og:url` meta tag, an `itemprop="identifier"` meta tag, the `"externalId"` key, and the `channel_id` parameter inside `"rssUrl"`. In this sample all five agreed with each other on every channel checked [11]. The value you want is in the document. The naive pattern still finds a channelId, just a different, equally well-formed UC ID, and it finds that one sooner.
Then the rate. Fifteen wrong out of sixteen is 93.75% [1], and that is a claim about that handle list, not yours. For it to transfer, your handles have to be channels whose pages render a featured shelf. The sample is stocked with exactly that kind of channel: a VEVO mirror at @BillieEilish, a second channel at @Mathologer, a translation at @veritasium, spinoffs at @mkbhd and @Fireship [4][14]. Resolve a list of small channels instead and more of them will have no shelf, your naive resolver will score better, and the failures will be intermittent and tied to page layout rather than to anything in your code. The wrong answer gives no sign of being wrong: no exception, the expected row count, plausible titles [8].
One piece of craft to copy. The author notes that `{22}` in those patterns is a validity check and not an over-match guard, because each pattern terminates at a closing quote and `"` is in neither `\w` nor `-`, so `UC[\w-]+` would capture the same characters [13]. A comment explaining what a quantifier is not doing is worth more than the quantifier.
If you already have a table keyed by handle, the check is the one that caught this: take the ID you stored, ask YouTube's public feed what that ID is called, and compare the answer to the handle you asked for [1]. The author found it via an unrelated log line, hours after publishing, when @veritasium came back as Veritasium en Francais [10].
Ranked by verification strength, evidence, and original report placement.
For each handle the author fetched https://www.youtube.com/@name, pulled the first "channelId":"UC..." out of the HTML, separately pulled the ID from the page's <link rel="canonical">, then asked YouTube's public feed what each ID is actually called.
In the author's sample of 16 handles, the first-"channelId" method returned the wrong channel 15 times out of 16.
@3blue1brown's first "channelId" match resolves to Mathologer, an independent channel run by a maths professor at Monash University with no organisational connection to 3Blue1Brown.
Other first-match results: @mkbhd returns The Studio, @kurzgesagt returns Nightshift - Kurzgesagt After Dark, @Fireship returns Beyond Fireship, @veritasium returns Veritasium en Francais, @BillieEilish returns BillieEilishVEVO.
Further first-match results: @Computerphile returns Numberphile, @ThePrimeagen returns The PrimeTime, @LinusTechTips returns ShortCircuit, @beyondfireship returns Fireship, @Mathologer returns Mathologer 2, @nightshift returns Kurzgesagt - In a Nutshell.
On all three pages whose position the author checked, the first "channelId" sat inside a gridChannelRenderer within a horizontalListRenderer (a featured-channels shelf), between 37% and 84% of the way through a 1.7 to 2.5 MB document.
Distinct publishers with included, body-backed reporting in this cluster.
dev.to
1 article · August 29, 2026
Follow any of these and your For You feed starts watching them — no settings page required.
build
A reducer seeded at zero erased a 6,300-cent downside from the frontier summary1 distinct publisher
build
Google Trends returns 200 OK with an empty body when it blocks you1 distinct publisher
build
The capture returned HTTP 200. The file was a Cloudflare block page.1 distinct publisher
build
Retry Loops Fail Because They Classify Nothing: A Per-Failure-Class Taxonomy1 distinct publisher
Evidence-backed comparisons of source perspectives and observed adoption signals. Read the methodology
Which Builder, Operator, and Investor concerns the observed source mix emphasized—not a truth score.
Evidence, demonstrated adoption, hype gap, incentives, and confidence are assessed independently, each on its own current evidence. How these are measured.
One run, but a run you can repeat in a minute
The 15-of-16 result arrives with the things scraping posts usually skip: both resolution paths printed for every handle, an independent cross-check against YouTube's own feed, the JSON path and byte position of the offending string on three pages, and the extractor as source. dev.to's author also fences his own number — sixteen channels he chose, all large, one IP, one day, hl=en&gl=US — and refuses to state a failure rate for channels unlike those. The gap is replication: nobody else has fetched a single page.
The bug is demonstrated; its footprint is not
The post opens by telling readers they are probably getting the wrong channel, but the only code shown doing it belongs to the author. Nothing here counts the libraries, tutorials or repositories that reach for the first "channelId", and nothing tracks whether the five-marker extractor has been picked up anywhere. One confirmed casualty — his own retracted survey — establishes that the failure happens in the wild without saying how widely.
The headline is smaller than the finding
Title and framing say precisely what the sample supports, and the closing note voluntarily narrows it. If anything the piece undersells itself: buried in the same passage that admits the limits is the more unsettling result — the one channel the shortcut got right is the one without a featured-channels shelf, so the natural test case is the one that certifies a broken resolver.
The author is the one who comes out looking bad
No product, no API vendor, no referral: the recommended fix is nine lines of regex and a public XML feed, and the star exhibit is the writer's own retracted measurement. That is about as low as reputational incentive gets. The one distortion worth naming is the shape of any confession post — a writer reconstructing his own mistake has some reason to make the trap sound unavoidable rather than avoidable, and the emphasis on "nothing throws" does exactly that work.
Verifiable today, perishable tomorrow
Two things hold the number down: everything rests on one afternoon's fetches by one person, and it describes a page Google can restructure without notice — the author concedes a format change breaks all five of his patterns. Two things hold it up: any reader can falsify the claim in a minute using the feed URL printed in the post, and the observation that five independent self-referential markers agreed on every channel is a stronger structural argument than the failure tally.