---
name: youtube-content-analysis
description: Specialized workflows for extracting, processing, and analyzing YouTube content (transcripts, metadata, visual elements).
---

# YouTube Content Extraction & Analysis

Specialized workflows for extracting, processing, and analyzing YouTube content (transcripts, metadata, visual elements).

## Triggers
- "Summarize this YouTube video"
- "Get the transcript for [URL]"
- "Analyze the content of this video"
- "Extract text from this YouTube link"

## Workflow
1. **Extraction Strategy**:
    - **Primary**: Attempt `web_extract` for direct markdown/text content.
    - **Secondary**: If `web_extract` fails or returns empty, use `browser_navigate` to the URL.
    - **Tertiary (Transcript)**:
        - Open the video page.
        - Click the "Subtitles/CC" button (`ref=e179` or similar).
        - Click the "More" button in the description if needed to find "Show transcript".
        - Once the transcript panel is open, use `browser_console` to scrape all `.ytp-transcript-segment-text` elements.
2. **Analysis**:
    - Summarize key points.
    - Extract specific entities, technical terms, or actionable items.
    - Cross-reference with other research if required.

## Pitfalls
- **Empty Extraction**: `web_extract` often fails on YouTube due to dynamic loading. Always fallback to `browser_navigate` + `browser_snapshot`/`browser_console`.
- **Transcript Panel State**: The transcript panel is NOT open by default. You MUST explicitly click the "Show transcript" button in the UI before attempting to scrape transcript segments via `browser_console`.
- **Bot Detection**: YouTube is aggressive against headless browsers. If navigation fails, consider the user may need to provide a proxy or manual intervention.
- **Dynamic Ref IDs**: Element `ref` IDs (e.g., `@e179`) are transient and change per session. Use text-based selectors or `browser_console` with `document.querySelector` for reliability.

## References
- `references/youtube-scraping-patterns.md` - Common DOM selectors and JS snippets for transcript extraction.
