Skip to content

video: a channel may be written as @handle — resolved server-side, card keeps the handle - #64

Merged
cverorg merged 1 commit into
mainfrom
kitt/yt-handle
Sep 24, 2026
Merged

cverorg merged 1 commit into
mainfrom
kitt/yt-handle

Conversation

@cverorg

@cverorg cverorg commented Sep 24, 2026

Copy link
Copy Markdown
Member

What a creator knows about their channel is youtube.com/@name (the channel page's share button);
nobody knows their UC id. Until now the Video sheet handed that URL back unchanged and the Worker
never resolved it, so "always show my newest video" silently landed on the degraded state.

  • yt.mjs: channel=@name is a channel ref. resolveHandle fetches the public handle page and reads
    <meta itemprop="identifier"> (🔴 not the first "channelId" in the page JSON — on a real page
    those are three OTHER channels), then the feed as before. Answers carry channelId, keyed by
    what the card wrote. Same deadline, never throws, one fetch per handle (not per card/visitor);
    the visitor's browser still never talks to YouTube before pressing play.
  • card-render: plays the resolved uploads playlist; when the handle could not resolve, the button
    opens the channel page instead of building list=UU… from a handle (a door, not a dead player).
  • card-worker: handle pages cached a day, feeds 30 min (ytFetch).
  • youtubeRef: youtube.com/@name(/videos) and bare @name normalise to the handle.
  • hint copy (9 langs) names the handle form first. edit2-assets regenerated.

Tests: yt.test +5, three-questions table +4; cardtile suite 313/313.
Measured: @nasa / @mkbhd pages 0.8–2.5 MB, 0.5–0.8 s, identifier meta present with any UA; a
missing handle is a 404.

Deploy: Card Worker (production) after merge, then a real-card check with a channel=@NASA tile. 站台側; KITT merges on green.

…the card keeps the handle

What a creator knows about their channel is `youtube.com/@name` (the channel page's share button);
nobody knows their UC id. Until now the Video sheet handed that URL back unchanged and the Worker
never resolved it, so "always show my newest video" silently landed on the degraded state.

- yt.mjs: `channel=@name` is a channel ref. resolveHandle fetches the public handle page and reads
  `<meta itemprop="identifier">` (🔴 not the first "channelId" in the page JSON — on a real page
  those are three OTHER channels), then the feed as before. Answers carry `channelId`, keyed by
  what the card wrote. Same deadline, never throws, one fetch per handle (not per card/visitor);
  the visitor's browser still never talks to YouTube before pressing play.
- card-render: plays the resolved uploads playlist; when the handle could not resolve, the button
  opens the channel page instead of building list=UU… from a handle (a door, not a dead player).
- card-worker: handle pages cached a day, feeds 30 min (ytFetch).
- youtubeRef: `youtube.com/@name(/videos)` and bare `@name` normalise to the handle.
- hint copy (9 langs) names the handle form first. edit2-assets regenerated.

Tests: yt.test +5, three-questions table +4; cardtile suite 313/313.
Measured: @nasa / @mkbhd pages 0.8–2.5 MB, 0.5–0.8 s, identifier meta present with any UA; a
missing handle is a 404.
@cverorg
cverorg merged commit e93f2b6 into main Sep 24, 2026
2 checks passed
@cverorg
cverorg deleted the kitt/yt-handle branch September 24, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant