video: a channel may be written as @handle — resolved server-side, card keeps the handle - #64
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
channel=@nameis 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 pagethose are three OTHER channels), then the feed as before. Answers carry
channelId, keyed bywhat 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.
opens the channel page instead of building list=UU… from a handle (a door, not a dead player).
youtube.com/@name(/videos)and bare@namenormalise to the handle.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=@NASAtile. 站台側; KITT merges on green.