docs/YouTube-Processing.md
Fabric provides powerful YouTube video processing capabilities that allow you to extract transcripts, comments, and metadata from YouTube videos and playlists. This guide covers all the available options and common use cases.
yt-dlp: Required for transcript extraction. Install on MacOS with:
brew install yt-dlp
Or use the package manager of your choice for your operating system.
See the yt-dlp wiki page for your specific installation instructions.
YouTube API Key (optional): Only needed for comments and metadata extraction. Configure with:
fabric --setup
Extract a video transcript and process it with a pattern:
fabric -y "https://www.youtube.com/watch?v=VIDEO_ID" --pattern summarize
Get transcript with timestamps preserved:
fabric -y "https://www.youtube.com/watch?v=VIDEO_ID" --transcript-with-timestamps --pattern extract_wisdom
Get video comments (requires YouTube API key):
fabric -y "https://www.youtube.com/watch?v=VIDEO_ID" --comments --pattern analyze_claims
Get video metadata as JSON:
fabric -y "https://www.youtube.com/watch?v=VIDEO_ID" --metadata
Pass additional arguments to yt-dlp for advanced functionality. User-provided arguments take precedence over built-in fabric arguments, giving you full control:
# Use browser cookies for age-restricted or private videos
fabric -y "https://www.youtube.com/watch?v=VIDEO_ID" --yt-dlp-args="--cookies-from-browser brave"
# Override language selection (takes precedence over -g flag)
fabric -g en -y "https://www.youtube.com/watch?v=VIDEO_ID" --yt-dlp-args="--sub-langs es,fr"
# Use specific format
fabric -y "https://www.youtube.com/watch?v=VIDEO_ID" --yt-dlp-args="--format best"
# Handle rate limiting (slow down requests)
fabric -y "https://www.youtube.com/watch?v=VIDEO_ID" --yt-dlp-args="--sleep-requests 1"
# Multiple arguments (use quotes)
fabric -y "https://www.youtube.com/watch?v=VIDEO_ID" --yt-dlp-args="--cookies-from-browser firefox --write-info-json"
# Combine rate limiting with authentication
fabric -y "https://www.youtube.com/watch?v=VIDEO_ID" --yt-dlp-args="--cookies-from-browser brave --sleep-requests 1"
# Override subtitle format (takes precedence over built-in --sub-format vtt)
fabric -y "https://www.youtube.com/watch?v=VIDEO_ID" --yt-dlp-args="--sub-format srt"
Fabric constructs the yt-dlp command in this order:
--write-auto-subs, --skip-download, etc.)-g flag): --sub-langs LANGUAGE--yt-dlp-args): These override any conflicting built-in argumentsThis means you can override any built-in behavior by specifying it in --yt-dlp-args.
Process entire playlists:
# Process all videos in a playlist
fabric -y "https://www.youtube.com/playlist?list=PLAYLIST_ID" --playlist --pattern summarize
# Save playlist videos to CSV
fabric -y "https://www.youtube.com/playlist?list=PLAYLIST_ID" --playlist -o playlist.csv
Specify transcript language:
fabric -y "https://www.youtube.com/watch?v=VIDEO_ID" -g es --pattern translate
You can combine multiple YouTube processing options:
# Get transcript, comments, and metadata
fabric -y "https://www.youtube.com/watch?v=VIDEO_ID" \
--transcript \
--comments \
--metadata \
--pattern comprehensive_analysis
# Save output to file
fabric -y "https://www.youtube.com/watch?v=VIDEO_ID" --pattern summarize -o summary.md
# Save entire session including input
fabric -y "https://www.youtube.com/watch?v=VIDEO_ID" --pattern summarize --output-session -o full_session.md
Get real-time streaming output:
fabric -y "https://www.youtube.com/watch?v=VIDEO_ID" --pattern summarize --stream
# Analyze video content for key insights
fabric -y "https://www.youtube.com/watch?v=VIDEO_ID" --pattern extract_wisdom
# Check claims made in the video
fabric -y "https://www.youtube.com/watch?v=VIDEO_ID" --pattern analyze_claims
# Create study notes from educational videos
fabric -y "https://www.youtube.com/watch?v=VIDEO_ID" --pattern create_study_notes
# Extract key concepts and definitions
fabric -y "https://www.youtube.com/watch?v=VIDEO_ID" --pattern extract_concepts
# Summarize conference talks with timestamps
fabric -y "https://www.youtube.com/watch?v=VIDEO_ID" \
--transcript-with-timestamps \
--pattern meeting_summary
# Extract action items from recorded meetings
fabric -y "https://www.youtube.com/watch?v=VIDEO_ID" --pattern extract_action_items
# Create social media posts from video content
fabric -y "https://www.youtube.com/watch?v=VIDEO_ID" --pattern create_social_posts
# Generate blog post from video transcript
fabric -y "https://www.youtube.com/watch?v=VIDEO_ID" --pattern write_blog_post
--yt-dlp-args="--cookies-from-browser BROWSER"fabric --setup to configure YouTube API--yt-dlp-args for authentication--yt-dlp-args="--sleep-requests 5"--yt-dlp-args="--cookies-from-browser brave --sleep-requests 5"fabric -g en (English subtitles may be less rate-limited)When you specify a language (e.g., -g es for Spanish) but that language isn't available or fails to download:
# Even if Spanish isn't available, this will work with whatever language yt-dlp finds
fabric -g es -y "https://youtube.com/watch?v=VIDEO_ID" --pattern summarize
You can set default yt-dlp arguments in your config file (~/.config/fabric/config.yaml):
ytDlpArgs: "--cookies-from-browser brave --write-info-json"
Set up your YouTube API key:
export FABRIC_YOUTUBE_API_KEY="your_api_key_here"
--sleep-requests 1 to slow down requests--yt-dlp-args to override any built-in behavior when neededyt-dlp --list-subs URL to see available subtitle languages before processingfabric -y "https://www.youtube.com/watch?v=dQw4w9WgXcQ" --pattern summarize --stream
fabric -y "https://www.youtube.com/watch?v=VIDEO_ID" \
--yt-dlp-args="--cookies-from-browser chrome" \
--transcript-with-timestamps \
--comments \
--pattern comprehensive_analysis \
-o analysis.md
fabric -y "https://www.youtube.com/playlist?list=PLrAXtmRdnEQy6nuLvVUxpDnx4C0823vBN" \
--playlist \
--pattern extract_wisdom \
-o playlist_wisdom.md
# Built-in language selection (-g es) is overridden by user args
fabric -g es -y "https://www.youtube.com/watch?v=VIDEO_ID" \
--yt-dlp-args="--sub-langs fr,de,en" \
--pattern translate
For more patterns and advanced usage, see the main Fabric documentation.