$npx -y skills add axoviq-ai/synthadoc --skill youtubeExtract transcripts from YouTube videos via the YouTube caption system
| 1 | # YouTube Skill |
| 2 | |
| 3 | Extracts the transcript (captions) from a YouTube video using the YouTube |
| 4 | caption system — no API key or audio download required. Optionally uses a |
| 5 | vision-capable LLM to produce a structured summary (Overview, Topics, |
| 6 | Key takeaways) before the raw transcript. |
| 7 | |
| 8 | ## Setup |
| 9 | |
| 10 | ```bash |
| 11 | pip install youtube-transcript-api |
| 12 | ``` |
| 13 | |
| 14 | ## Standalone usage |
| 15 | |
| 16 | **Transcript only** (no LLM required): |
| 17 | |
| 18 | ```python |
| 19 | import asyncio |
| 20 | from synthadoc.skills.youtube.scripts.main import YoutubeSkill |
| 21 | |
| 22 | skill = YoutubeSkill() # no provider — returns raw timestamped transcript |
| 23 | |
| 24 | async def main(): |
| 25 | result = await skill.extract("https://www.youtube.com/watch?v=dQw4w9WgXcQ") |
| 26 | print(result.text) # "[0:00] text [0:04] text ..." |
| 27 | print(result.metadata) # {"video_id": "...", "title": "...", "url": "..."} |
| 28 | |
| 29 | asyncio.run(main()) |
| 30 | ``` |
| 31 | |
| 32 | **With LLM summarization** (pass any provider that implements `complete()`): |
| 33 | |
| 34 | ```python |
| 35 | skill = YoutubeSkill(provider=my_provider) |
| 36 | result = await skill.extract(url) |
| 37 | # result.text contains: |
| 38 | # ## Executive Summary |
| 39 | # <Overview / Topics / Key takeaways> |
| 40 | # |
| 41 | # ## Transcript |
| 42 | # [0:00] ... |
| 43 | ``` |
| 44 | |
| 45 | The provider must implement: |
| 46 | ```python |
| 47 | async def complete(messages, system=None, temperature=0.0, max_tokens=4096) |
| 48 | -> object with .text (str), .input_tokens (int), .output_tokens (int) |
| 49 | ``` |
| 50 | |
| 51 | `Message` (used to build the `messages` list) is importable from |
| 52 | `synthadoc.skills.base`: |
| 53 | ```python |
| 54 | from synthadoc.skills.base import Message |
| 55 | ``` |
| 56 | |
| 57 | ## When this skill is used |
| 58 | |
| 59 | - Source starts with `https://www.youtube.com/`, `https://youtu.be/`, or |
| 60 | `https://www.youtubekids.com/` |
| 61 | |
| 62 | To search YouTube by topic instead of ingesting a specific URL, use the web |
| 63 | search skill — it filters Tavily results to YouTube domains automatically: |
| 64 | |
| 65 | ```bash |
| 66 | synthadoc ingest "youtube Moore's Law" |
| 67 | synthadoc ingest "youtube kids: Sesame Street" |
| 68 | synthadoc ingest "search for youtube: history of computing" |
| 69 | ``` |
| 70 | |
| 71 | ## Limitations |
| 72 | |
| 73 | - Only works for videos that have captions (auto-generated or manually added). |
| 74 | If no captions are available the source is skipped with a warning. |
| 75 | - Private or deleted videos are skipped gracefully. |