Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

Auth Media Vision

БесплатноБез исполняемых скриптовНе проверен

Capture authenticated social-feed media (videos, images, audio) from a logged-in browser and actually understand it — frames AND speech — with the webrain MCP…

prokopis3от prokopis393 установки в других каталогах

Об этом скилле

/auth-media-vision

One pipeline, six steps. Every step below was verified end-to-end; the notes are the failures, not theory.

Prereqs. A real Chrome with a logged-in profile reachable over CDP (--port 9222), plus an exported cookie jar (webrain cookies --port 9222 --out out/auth.json).


Step 1 — harvest the post list (one call)

webrain_batch op=interact, concurrency=1, cdp_urls=["http://127.0.0.1:9222"]. The interaction scrolls and collects. Keep it short: background tabs throttle timers to ~1/s, long awaits can resolve null.

(async () => {
  const seen = [];
  const grab = () => document.querySelectorAll('article').forEach(a => {
    const link = a.querySelector('a[href^="/p/"], a[href^="/reel/"]');
    if (!link) return;                                  // ads have no post URL
    const href = link.getAttribute('href');
    if (seen.some(x => x.href === href)) return;
    seen.push({ href, type: a.querySelector('video') ? 'video' : 'image',
                caption: (a.innerText || '').replace(/\s+/g, ' ').slice(0, 120) });
  });
  for (let i = 0; i < 16 && seen.length < 12; i++) {
    grab(); window.scrollBy(0, Math.round(window.innerHeight * 0.8));
    await new Promise(r => setTimeout(r, 800));
  }
  grab();
  return JSON.stringify({ count: seen.length, items: seen.slice(0, 12) });
})()

Trap 1 — profile pictures. img[src*="cdninstagram"] matches avatars (s150x150). Filter naturalWidth > 200 and keep the largest, or you will vision a 150px blob.

Trap 2 — sponsored posts. Give them href: null and skip them; there is no post page to open.

Step 2 — capture the real media URLs (one batch call)

Post pages expose only og:image — no og:video. The <video> element holds a blob: MediaSource URL, not a fetchable file. The mp4 exists only in the page's network traffic:

(async () => {
  const t0 = Date.now();                                  // Trap 4: at readyState:complete the
  let v = null;                                           // <video> is often not mounted yet
  while (Date.now() - t0 < 9000 && !(v = document.querySelector('video'))) {
    await new Promise(r => setTimeout(r, 250));           // background tabs throttle to ~1/s
  }
  if (!v) return JSON.stringify('NO_VIDEO');
  v.muted = false; v.volume = 1;                          // MUST be unmuted, see Trap 3
  try { await v.play(); } catch (e) {}
  await new Promise(r => setTimeout(r, 3500));

  const es = [...new Set(performance.getEntriesByType('resource').map(e => e.name)
    .filter(n => /\/o1\/v\/.*\.mp4/i.test(n))
    .map(u => u.split('&bytestart')[0].split('&byteend')[0]))];   // DASH range params
  return JSON.stringify(es.sort((a, b) =>
    (b.indexOf('720p') > -1 ? 1 : 0) - (a.indexOf('720p') > -1 ? 1 : 0))[0] || 'NONE');
})()

Return one URL per tab. Returning several blows the tool's inline limit and dumps the payload to a file you then have to read back.

Trap 3 — muted playback = no audio track, forever. Setting v.muted = true (what autoplay needs) means the browser never requests the audio representation, so the only mp4 you can capture is video-only (ffprobe shows one vp9 stream). The fix is order-dependent:

  1. webrain_interact action=click on the player's mute control — a trusted click, so unmuting is allowed.
  2. Then in JS: v.muted = false; v.volume = 1; await v.play().
  3. Audio segments now appear as /o1/v/t2/f2/m78/…mp4 — decode the efg param (base64 JSON): dash_ln_heaac_vbr3_audio. Its xpv_asset_id matches the video's, which is how you pick the right track from the preloaded next-reel.

Step 3 — download (webrain_download, engine=http)

webrain_download with dir, engine: "http", filter_extension: ".mp4", all URLs at once. Signed CDN URLs work without cookies — but pass the jar if a site does require it.

Step 4 — mux, and prove it

ffmpeg -y -v error -i vid.mp4 -i aud.mp4 -c copy -movflags +faststart full.mp4
ffprobe -v error -show_entries stream=index,codec_type,codec_name,duration -of csv=p=0 full.mp4
# want exactly:   0,vp9,video,59.8   1,aac,audio,59.9

No aac line means you captured a silent file — go back to Trap 3.

Step 5 — vision: read the frames watch already made

Rule: never build frames yourself if watch already did. webrain_watch returns frames: [{index, t, path}] next to the transcript — 17 for an 8 s clip, 20–100 for longer (see Detail). Those files are on disk, full resolution, already ordered by time. Open 3–5 of them with your image-viewing tool:

frame_0001.jpg   t≈0.0      # but see the black-first-frame note below
frame_0005.jpg             # successive frames if the clip is short
frame_0009.jpg   middle
frame_0013.jpg
frame_0017.jpg   end

That is the whole step. No ffmpeg, no HTML page, no navigate.

Reading beats sampling: pick frames where the content changes, not by even spacing. Start / first visible

Полный SKILL.md на ClawHub

Установить Auth Media Vision в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Bash
Read
Write

FAQ

Что делает скилл Auth Media Vision?

Capture authenticated social-feed media (videos, images, audio) from a logged-in browser and actually understand it — frames AND speech — with the webrain MCP tools. Use when asked to scrape a feed/gallery behind a login, download posts, watch videos, or "use vision to understand" a batch of media. Read the frames webrain_watch already extracted (montage only as fallback). Covers the traps that silently produce useless output: empty audio track, missing STT, and per-item vision calls that take 20 round-trips.

Как установить скилл Auth Media Vision?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл Auth Media Vision запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить Auth Media Vision с