From youtube
Extract transcript from a YouTube video. Use when the user provides a YouTube URL or video ID and wants the content/transcript.
npx claudepluginhub vbonnet/dear-agent --plugin youtube{youtube-url-or-video-id}# YouTube Transcript Extraction
I'll extract the transcript from a YouTube video.
**Step 1: Parse and validate input**
Parse $ARGUMENTS to extract the YouTube URL or video ID. Do NOT use bash conditionals — handle all logic in your reasoning layer.
**1.1: Check for empty input**
- If $ARGUMENTS is empty or whitespace only:
- Show error: "No YouTube URL or video ID provided"
- Show message: "Usage: /youtube {youtube-url-or-video-id}"
- Exit gracefully
**1.2: Determine URL and video ID**
- If $ARGUMENTS is an 11-character alphanumeric string (video ID only):
- Construct full URL:.../youtubeAccess YouTube content - search, get channel info, retrieve videos, transcripts
I'll extract the transcript from a YouTube video.
Step 1: Parse and validate input
Parse $ARGUMENTS to extract the YouTube URL or video ID. Do NOT use bash conditionals — handle all logic in your reasoning layer.
1.1: Check for empty input
1.2: Determine URL and video ID
https://www.youtube.com/watch?v={VIDEO_ID}youtube.com/watch?v=XXXXXXXXXXX — extract the v parameter as VIDEO_IDyoutu.be/XXXXXXXXXXX — extract the path segment as VIDEO_IDyoutube.com/shorts/XXXXXXXXXXX — extract the path segment as VIDEO_IDyoutube.com/live/XXXXXXXXXXX — extract the path segment as VIDEO_IDNote: Parse the URL in your reasoning layer. Do NOT use bash if/elif/else conditionals.
Step 2: Create temp directory
Run: mkdir -p /tmp/yt-transcript
Step 3: Fetch video title
Run: yt-dlp --print title "VIDEO_URL"
Step 4: Fetch subtitles
Run: yt-dlp --write-auto-sub --sub-lang en --skip-download --sub-format vtt -o "/tmp/yt-transcript/%(id)s" "VIDEO_URL"
Step 5: Locate the VTT file
Run: ls /tmp/yt-transcript/VIDEO_ID*.vtt
Step 6: Parse VTT to clean text
Run the following sed + awk pipeline as a single command:
sed '/^WEBVTT/d; /^Kind:/d; /^Language:/d; /^NOTE/d; /^$/d; /^[0-9]*$/d; /-->/d; s/<[^>]*>//g; s/ / /g; s/&/\&/g; s/</</g; s/>/>/g' "VTT_FILE" | awk '!seen[$0]++' > "/tmp/yt-transcript/VIDEO_ID.txt"
This pipeline:
<c> tags)Step 7: Get character count
Run: wc -c < /tmp/yt-transcript/VIDEO_ID.txt
Store the trimmed output as CHAR_COUNT.
Step 8: Read and present the transcript
Use the Read tool to read /tmp/yt-transcript/VIDEO_ID.txt.
Present the output in this format:
**VIDEO_TITLE**
VIDEO_URL
CHAR_COUNT characters | Saved to /tmp/yt-transcript/VIDEO_ID.txt
---
TRANSCRIPT_CONTENT
Step 9: Clean up VTT file
Run: rm -f "VTT_FILE"
Keep the .txt file for later reference during the session.
Error Handling: