Skip to main content

YouTube Guide Command

The youtube-guide command combines the functionality of process-youtube and generate-guide into a single command. It downloads a YouTube video, processes it, and generates a step-by-step guide, all in one operation.

Usage

transfer-learning youtube-guide URL [OPTIONS]

Arguments

ArgumentDescription
URLYouTube video URL

Options

OptionDescriptionDefault
--output-dir TEXTOutput directory for guidesguides/
--model TEXTModel to use for guide generationFrom config
--temperature FLOATTemperature for generation0.2
--batch-size INTEGERNumber of frames to process in each batchFrom config
--max-concurrent INTEGERMaximum number of concurrent batchesFrom config
--frame-interval INTEGERInterval between frame extractions in seconds30
--user-directive TEXTUser directive to customize guide generationNone
--skip-cacheSkip cache and force regenerationFalse
--quality TEXTVideo quality to download (best, 1080p, 720p, etc.)best
--format TEXTOutput format (json, markdown, html)json
--helpShow help message and exit-

Examples

Generate a guide from a YouTube video

transfer-learning youtube-guide "https://www.youtube.com/watch?v=dQw4w9WgXcQ"

Generate a guide with custom directive

transfer-learning youtube-guide "https://www.youtube.com/watch?v=dQw4w9WgXcQ" --user-directive "Focus on technical details"

Generate a guide with specific model and format

transfer-learning youtube-guide "https://www.youtube.com/watch?v=dQw4w9WgXcQ" --model gpt-4-vision-preview --format markdown

Generate a guide with custom frame interval

transfer-learning youtube-guide "https://www.youtube.com/watch?v=dQw4w9WgXcQ" --frame-interval 10

Output

The command creates a complete directory structure with both the processed video data and the generated guide:
output_dir/
├── video_title/
│   ├── frames/
│   │   ├── frame_0001.jpg
│   │   ├── frame_0002.jpg
│   │   └── ...
│   ├── metadata.json
│   ├── analysis.json
│   ├── video.mp4
│   └── guide.json

Guide Format

The generated guide has the following structure:
{
  "title": "Process Title",
  "description": "Overall process description",
  "steps": [
    {
      "step_number": 1,
      "title": "Step Title",
      "description": "Step description",
      "tools_used": ["tool1", "tool2"],
      "duration": 10.5,
      "key_points": ["point1", "point2"],
      "timestamp": 0.0
    }
  ],
  "principles": [
    {
      "name": "Principle Name",
      "description": "Principle description",
      "importance": "Why this principle matters",
      "examples": ["example1", "example2"]
    }
  ],
  "total_duration": 120.5,
  "source_type": "youtube",
  "source_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}

Processing Pipeline

The youtube-guide command performs the following steps:
  1. Validates the YouTube URL
  2. Downloads the video using yt-dlp
  3. Extracts frames at the specified interval
  4. Analyzes the frames using AI
  5. Generates a step-by-step guide based on the analysis
  6. Saves the guide in the specified format

Customizing Guide Generation

You can customize the guide generation process using the --user-directive option. This allows you to specify what aspects of the video to focus on or what style to use for the guide. Examples of user directives:
  • “Focus on technical details and tools used”
  • “Emphasize beginner-friendly explanations”
  • “Highlight safety considerations”
  • “Include more detailed steps for complex parts”