home / skills / composiohq / awesome-codex-skills / video-downloader

video-downloader skill

/video-downloader

This skill downloads YouTube videos with controllable quality and format, delivering MP4, WebM, MKV, or MP3 outputs.

npx playbooks add skill composiohq/awesome-codex-skills --skill video-downloader

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
2.6 KB
---
name: youtube-downloader
description: Download YouTube videos with customizable quality and format options. Use this skill when the user asks to download, save, or grab YouTube videos. Supports various quality settings (best, 1080p, 720p, 480p, 360p), multiple formats (mp4, webm, mkv), and audio-only downloads as MP3.
---

# YouTube Video Downloader

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

## Quick Start

The simplest way to download a video:

```bash
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:
```bash
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:
```bash
python scripts/download_video.py "URL" -f webm
```

### Audio Only

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

```bash
python scripts/download_video.py "URL" -a
```

### Custom Output Directory

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

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

## Complete Examples

1. Download video in 1080p as MP4:
```bash
python scripts/download_video.py "https://www.youtube.com/watch?v=dQw4w9WgXcQ" -q 1080p
```

2. Download audio only as MP3:
```bash
python scripts/download_video.py "https://www.youtube.com/watch?v=dQw4w9WgXcQ" -a
```

3. Download in 720p as WebM to custom directory:
```bash
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

Overview

This skill downloads YouTube videos with selectable quality and format options, and can extract audio as MP3. It saves files to a default output folder and supports direct command-line usage for single-video downloads. The tool uses yt-dlp under the hood to fetch and assemble the best matching streams. It is optimized for quick, reproducible downloads with configurable output location.

How this skill works

When given a YouTube URL the skill queries yt-dlp for available streams and metadata, then selects streams that match the requested quality and format. If video and audio are separate, it merges them into a single file using the chosen container (mp4, webm, mkv). For audio-only requests it extracts and converts audio to MP3. The script installs yt-dlp if missing and writes files to /mnt/user-data/outputs/ by default, with an option to override the output directory.

When to use it

  • Save a single YouTube video for offline viewing
  • Extract audio from a video as an MP3 podcast or clip
  • Convert a video to a specific container (mp4, webm, mkv)
  • Download at a defined quality (1080p, 720p, 480p, 360p) to manage file size
  • Automate one-off downloads via CLI in scripts or workflows

Best practices

  • Prefer specific quality flags (e.g., 720p) to control file size and download time
  • Use audio-only mode for music or podcasts to save bandwidth and storage
  • Set a custom output directory when running in environments with limited default storage
  • Check available formats before large downloads to ensure compatibility with playback devices
  • Avoid bulk or playlist downloads—this tool is designed for single-video operations

Example use cases

  • Download a tutorial in 1080p MP4 for high-quality offline reference
  • Grab a conference talk in 720p WebM to reduce file size for sharing
  • Extract a talk’s audio as an MP3 for listening on a phone
  • Save a demo video to a custom folder for use in a presentation
  • Quickly fetch the best-available copy with default settings for archival

FAQ

Can I download playlists or multiple videos at once?

No. The script is intended for single-video downloads and skips playlists by default.

Where are files saved and can I change that?

Files are saved to /mnt/user-data/outputs/ by default. Use the -o or --output option to specify a different directory.