YouTube

get-video

youtube.com · Cowork
Download for Coworkthe skill folder, zipped
How to use it in Coworkonce per skill
Download the skill (.zip)

One .zip per skill. Inside: SKILL.md with the intent and the frontmatter, and the code that runs in the page.

Open Skills in Cowork

Settings → Personalize → Skills. This is Cowork's own skill library, shared across every chat.

Add → pick the .zip

Click Add and choose the file you just downloaded. Cowork installs it once; no CLAUDE.md, no per-project setup.

Ask in plain language

The skill stays available in every session. Cowork runs it in your own Chrome, riding the session you are already signed into.

Side effectread
Authnone (session optional)
Needsnavigate · evaluate
Summary

Fetch a YouTube video's details: title, channel, exact view count, length and description.

Params
{"videoId":"string, REQUIRED (the 11-char id, or a full watch?v= / youtu.be / shorts / embed URL)"}
Returns
{"videoId":"string","title":"string","channel":"string","channelId":"string","url":"url","views":"string (exact count, e.g. \"1793569343\")","lengthSeconds":"int","publishDate":"ISO date","category":"string","keywords":"array of string","description":"string (full)"}
SKILL.md64 lines

youtube-get-video

Fetches one video's full details by id, chains straight off youtube-search-videos, and unlike it returns the exact numeric view count rather than a localised display string. Resolves in a single bridge call: the extractor fetches what it needs itself, so the params actually drive the request and no page is opened.

The extractor lives as text in the site's localStorage (key youtube-get-video) and is rebuilt on each call with synchronous eval. It is stored once and then persists across navigation and browser restarts, so on every run except the first it is already there.

Default action: just call (step 1). The call itself reports NEEDS_STORE when the extractor is missing or out of date, only then do you store it (step 2) and call again.

Versioning. The stored extractor is gated by VER (must match the version in the frontmatter above). Both snippets carry VER = "1", keep them in sync with the frontmatter. When evaluate.js changes, bump version and VER in both snippets: the next call sees the mismatch, returns NEEDS_STORE, and re-stores automatically. Storage stays at two keys (youtube-get-video and youtube-get-video:ver), overwritten each store, versions never accumulate.

1. Call (do this every run, params only, single bridge call)

await (() => {
  const KEY = "youtube-get-video", VER = "1";
  const s = localStorage.getItem(KEY);
  if (!s || localStorage.getItem(KEY + ":ver") !== VER) return 'NEEDS_STORE';
  const fn = eval('(' + s + ')');
  return fn(document, { videoId: "dQw4w9WgXcQ" });
})()

Returns the video's details. If it returns the string 'NEEDS_STORE', the extractor is missing or stale in this browser → do step 2 once, then run this exact call again.

Run this snippet verbatim. Never add an await before the eval, only the outer await is allowed.

Any youtube.com tab works, the extractor never reads the open page; the tab only supplies the origin and session.

2. Store (only when step 1 returned NEEDS_STORE; persists until localStorage is cleared)

From any youtube.com tab, evaluate the following with the bridge, replacing <FN> with the contents of evaluate.js (the ( async (root, params) => { ... } ) function). Keep VER equal to the call snippet's:

(() => {
  const KEY = "youtube-get-video", VER = "1";
  const fn = (<FN>);
  localStorage.setItem(KEY, String(fn));
  localStorage.setItem(KEY + ":ver", VER);
  return 'stored';
})()

Returns "stored". The extractor passes through the model only here, once. Then go back to step 1.

Identity assertion

The fetched page is checked against the id you asked for. If YouTube resolved another video, the call fails with tool-broken naming both ids rather than returning another video's details under yours.

Unlike youtube-search-videos, the fields here come from the player payload, not from rendered copy: views is an exact number and lengthSeconds an int, in any session language.

Errors

  • NEEDS_STORE → extractor missing or version-mismatched in this browser; run step 2 once, then retry step 1.
  • missing_params → pass an 11-char videoId or a watch URL.
  • not-available: <status> → the video is private, deleted, age-gated or region-blocked (verified: a bogus id returns not-available: ERROR).
  • tool-broken: asked for X but the page resolved to Y → YouTube redirected.
  • blocked → a consent wall; open youtube.com in the tab, accept once, retry.
  • request_failed / fetch fail → no youtube.com tab open, or the call ran cross-origin.

Success assertion

{ "type": "json", "jsonPath": "title" }
get-video: the YouTube skill in Cowork · browser-memory