Analyzes YouTube videos by fetching transcripts and providing summaries, insights, and answering questions about video content. Use when user asks to analyze, summarize, or understand YouTube videos.
Analyzes YouTube videos by fetching chapters and transcripts to provide structured summaries and insights.
From URL formats:
https://www.youtube.com/watch?v=VIDEO_IDhttps://youtu.be/VIDEO_IDhttps://www.youtube.com/watch?v=VIDEO_ID&other=paramsExtract the VIDEO_ID (11 characters, alphanumeric with - and _).
# List available transcripts
ktools yt-transcript list <video_id>
# Check for chapters
ktools yt-transcript chapters <video_id>
If no transcripts available:
If chapters available:
# Create workspace
mkdir -p ~/.tools/scratch
# Download transcript (check if already exists first)
ktools yt-transcript get <video_id> --output ~/.tools/scratch/yt-<video_id>.txt
Read the transcript:
Read: ~/.tools/scratch/yt-<video_id>.txt
Provide analysis based on user's request:
For summaries:
For questions:
[HH:MM:SS]For detailed analysis:
If video has many chapters or is very long:
Extract specific chapters:
# Example: Extract content from 1:38:00 to 2:00:00
grep "^\[1:38:" ~/.tools/scratch/yt-<video_id>.txt | head -n 100
grep "^\[1:[3-5][0-9]:" ~/.tools/scratch/yt-<video_id>.txt
Search for topics:
grep -i "topic keyword" ~/.tools/scratch/yt-<video_id>.txt
User: "Analyze https://www.youtube.com/watch?v=dQw4w9WgXcQ"
1. Extract video ID: dQw4w9WgXcQ
2. Check chapters: ktools yt-transcript chapters dQw4w9WgXcQ
3. Fetch: ktools yt-transcript get dQw4w9WgXcQ --output ~/.tools/scratch/yt-dQw4w9WgXcQ.txt
4. Read transcript and provide summary with key timestamps
[MM:SS] or [HH:MM:SS] format - always cite themFind when a topic is discussed:
grep -i "topic" ~/.tools/scratch/yt-<video_id>.txt
Extract a time range:
# Get content between 1:30:00 and 2:00:00
grep "^\[1:[3-5][0-9]:" ~/.tools/scratch/yt-<video_id>.txt
Show chapter structure:
ktools yt-transcript chapters <video_id>