Get the FREE Ultimate OpenClaw Setup Guide →

youtube-downloader

npx machina-cli add skill ECNU-ICALK/AutoSkill/youtube-downloader --openclaw
Files (1)
SKILL.md
2.7 KB

YouTube Video Downloader

Download YouTube videos with full control over quality and format settings.

Quick Start

The simplest way to download a video:

python scripts/download_video.py "https://www.youtube.com/watch?v=VIDEO_ID"

This downloads the video in best available quality as MP4 to /mnt/user-data/outputs/.

Options

Quality Settings

Use -q or --quality to specify video quality:

  • best (default): Highest quality available
  • 1080p: Full HD
  • 720p: HD
  • 480p: Standard definition
  • 360p: Lower quality
  • worst: Lowest quality available

Example:

python scripts/download_video.py "URL" -q 720p

Format Options

Use -f or --format to specify output format (video downloads only):

  • mp4 (default): Most compatible
  • webm: Modern format
  • mkv: Matroska container

Example:

python scripts/download_video.py "URL" -f webm

Audio Only

Use -a or --audio-only to download only audio as MP3:

python scripts/download_video.py "URL" -a

Custom Output Directory

Use -o or --output to specify a different output directory:

python scripts/download_video.py "URL" -o /path/to/directory

Complete Examples

  1. Download video in 1080p as MP4:
python scripts/download_video.py "https://www.youtube.com/watch?v=dQw4w9WgXcQ" -q 1080p
  1. Download audio only as MP3:
python scripts/download_video.py "https://www.youtube.com/watch?v=dQw4w9WgXcQ" -a
  1. Download in 720p as WebM to custom directory:
python scripts/download_video.py "https://www.youtube.com/watch?v=dQw4w9WgXcQ" -q 720p -f webm -o /custom/path

How It Works

The skill uses yt-dlp, a robust YouTube downloader that:

  • Automatically installs itself if not present
  • Fetches video information before downloading
  • Selects the best available streams matching your criteria
  • Merges video and audio streams when needed
  • Supports a wide range of YouTube video formats

Important Notes

  • Downloads are saved to /mnt/user-data/outputs/ by default
  • Video filename is automatically generated from the video title
  • The script handles installation of yt-dlp automatically
  • Only single videos are downloaded (playlists are skipped by default)
  • Higher quality videos may take longer to download and use more disk space

Source

git clone https://github.com/ECNU-ICALK/AutoSkill/blob/main/SkillBank/Common/AwesomeClaudeSkills/youtube-downloader/SKILL.mdView on GitHub

Overview

Download YouTube videos with customizable quality and format options. Choose from best, 1080p, 720p, 480p, and 360p, or audio-only MP3, and output as MP4, WebM, or MKV. The tool uses yt-dlp, auto-installs if needed, and saves to /mnt/user-data/outputs by default.

How This Skill Works

The skill uses yt-dlp to fetch video metadata, then selects the best available streams that match your -q/--quality and -f/--format settings. It merges audio and video when needed and automatically installs yt-dlp if it isn't present.

When to Use It

  • When you want to download a YouTube video for offline viewing.
  • When you need a specific quality (e.g., 1080p) for a presentation or device.
  • When you want a particular format (MP4, WebM, or MKV) for compatibility.
  • When you want audio-only content as MP3 for music or podcasts.
  • When you want to save files to a custom directory.

Quick Start

  1. Step 1: python scripts/download_video.py "<URL>"
  2. Step 2: (optional) add flags like -q 1080p, -f webm, or -a
  3. Step 3: check /mnt/user-data/outputs/ for the downloaded file

Best Practices

  • Verify that the chosen format is compatible with your playback device or player.
  • Balance quality and download time by selecting 1080p/720p or using best, depending on needs.
  • Use -a to download audio-only MP3 when you only need sound.
  • Rely on the automatic yt-dlp installation and default output path (/mnt/user-data/outputs/), unless you specify otherwise.
  • Note that by default only single videos are downloaded; for playlists, run per video or adjust your workflow.

Example Use Cases

  • python scripts/download_video.py "https://www.youtube.com/watch?v=dQw4w9WgXcQ" -q 1080p
  • python scripts/download_video.py "https://www.youtube.com/watch?v=dQw4w9WgXcQ" -a
  • python scripts/download_video.py "https://www.youtube.com/watch?v=dQw4w9WgXcQ" -q 720p -f webm -o /custom/path
  • python scripts/download_video.py "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  • python scripts/download_video.py "https://www.youtube.com/watch?v=VIDEO_ID" -q worst

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers