✓ Verified 💻 Development ✓ Enhanced Data

Video Download Faas

Download videos in MP4 format using yt-dlp with FaaS (Firecracker/Container) isolation.

Rating
3.9 (151 reviews)
Downloads
48,374 downloads
Version
1.0.0

Overview

Download videos in MP4 format using yt-dlp with FaaS (Firecracker/Container) isolation.

Complete Documentation

View Source →

Video Download FaaS

Download videos asynchronously using yt-dlp in isolated background processes. All downloads are saved as MP4 files.

Overview

This skill manages video downloads as background tasks that:

  • Start immediately and return control to the user
  • Continue running even if the session disconnects
  • Can be monitored for progress
  • Can be terminated when needed

When to Use

Use this skill when:

  • Downloading large videos that take time
  • Processing multiple videos concurrently
  • Running downloads on remote/headless systems
  • Need to continue working while downloading

Quick Start

Start a Download

bash
scripts/download.sh "https://youtube.com/watch?v=..."

Returns immediately with:

  • Session ID
  • Process ID (PID)
  • Log file location

Check Status

bash
# List all active downloads
scripts/check-status.sh

# Check specific download
scripts/check-status.sh video_dl_1234567890_12345

Kill Download

bash
# Graceful stop
scripts/kill-download.sh video_dl_1234567890_12345

# Force kill
scripts/kill-download.sh video_dl_1234567890_12345 --force

Commands

download.sh

Start a video download in background with MP4 output format.

Usage:

bash
download.sh <URL> [output_directory]

Parameters:

  • URL - Video URL to download (required)
  • output_directory - Where to save video (optional, default: ~/Downloads)
Output Format:
  • Downloads are automatically converted to MP4 format
  • Uses best available MP4 video + M4A audio, merged into MP4
  • If source isn't MP4, it will be re-encoded to MP4
Returns:
  • Session ID for tracking
  • PID for process management
  • Paths to log and session files
Example:
bash
scripts/download.sh "https://www.youtube.com/watch?v=dQw4w9WgXcQ" /tmp/videos

check-status.sh

Check download progress and status.

Usage:

bash
# List all sessions
check-status.sh

# Check specific session
check-status.sh <session_id>

Returns:

  • Process status (running/completed)
  • Download progress (if running)
  • Downloaded files (if completed)
  • Error information (if failed)

kill-download.sh

Terminate a running download.

Usage:

bash
kill-download.sh <session_id> [--force]

Parameters:

  • session_id - The session ID from download.sh
  • --force - Use SIGKILL instead of SIGTERM

Session Management

Session files are stored in /tmp/ with format:

  • video_dl_{timestamp}_{pid}.session - Session metadata
  • video_dl_{timestamp}_{pid}.pid - Process ID
  • video_dl_{timestamp}_{pid}.log - Download log
Sessions are automatically cleaned up when:
  • Download completes successfully
  • Process is killed via kill-download.sh

FaaS Integration

For containerized/Firecracker execution:

bash
# Run download in isolated container
./run-in-container.sh scripts/download.sh "URL"

# Check from host
scripts/check-status.sh

Troubleshooting

Download not starting:

  • Check yt-dlp is installed: yt-dlp --version
  • Verify URL is accessible: curl -I "URL"
Process not found:
  • Session may have completed and auto-cleaned
  • Check ~/Downloads for finished files
Permission denied:
  • Ensure scripts are executable: chmod +x scripts/*.sh

Requirements

  • yt-dlp installed and in PATH
  • Bash 4.0+
  • Write access to /tmp and output directory

Installation

Terminal bash

openclaw install video-download-faas
    
Copied!

💻Code Examples

scripts/download.sh "https://youtube.com/watch?v=..."

scriptsdownloadsh-httpsyoutubecomwatchv.txt
Returns immediately with:
- Session ID
- Process ID (PID)
- Log file location

### Check Status

scripts/kill-download.sh video_dl_1234567890_12345 --force

scriptskill-downloadsh-videodl123456789012345---force.txt
## Commands

### download.sh

Start a video download in background with **MP4 output format**.

**Usage:**

download.sh <URL> [output_directory]

downloadsh-url-outputdirectory.txt
**Parameters:**
- `URL` - Video URL to download (required)
- `output_directory` - Where to save video (optional, default: ~/Downloads)

**Output Format:**
- Downloads are automatically converted to **MP4** format
- Uses best available MP4 video + M4A audio, merged into MP4
- If source isn't MP4, it will be re-encoded to MP4

**Returns:**
- Session ID for tracking
- PID for process management
- Paths to log and session files

**Example:**

scripts/download.sh "https://www.youtube.com/watch?v=dQw4w9WgXcQ" /tmp/videos

scriptsdownloadsh-httpswwwyoutubecomwatchvdqw4w9wgxcq-tmpvideos.txt
### check-status.sh

Check download progress and status.

**Usage:**

check-status.sh <session_id>

check-statussh-sessionid.txt
**Returns:**
- Process status (running/completed)
- Download progress (if running)
- Downloaded files (if completed)
- Error information (if failed)

### kill-download.sh

Terminate a running download.

**Usage:**

kill-download.sh <session_id> [--force]

kill-downloadsh-sessionid---force.txt
**Parameters:**
- `session_id` - The session ID from download.sh
- `--force` - Use SIGKILL instead of SIGTERM

## Session Management

Session files are stored in `/tmp/` with format:
- `video_dl_{timestamp}_{pid}.session` - Session metadata
- `video_dl_{timestamp}_{pid}.pid` - Process ID
- `video_dl_{timestamp}_{pid}.log` - Download log

Sessions are automatically cleaned up when:
- Download completes successfully
- Process is killed via kill-download.sh

## FaaS Integration

For containerized/Firecracker execution:
example.sh
# List all active downloads
scripts/check-status.sh

# Check specific download
scripts/check-status.sh video_dl_1234567890_12345
example.sh
# Graceful stop
scripts/kill-download.sh video_dl_1234567890_12345

# Force kill
scripts/kill-download.sh video_dl_1234567890_12345 --force
example.sh
# List all sessions
check-status.sh

# Check specific session
check-status.sh <session_id>
example.sh
# Run download in isolated container
./run-in-container.sh scripts/download.sh "URL"

# Check from host
scripts/check-status.sh

Tags

#coding_agents-and-ides

Quick Info

Category Development
Model Claude 3.5
Complexity One-Click
Author lasurvivor
Last Updated 3/10/2026
🚀
Optimized for
Claude 3.5
🧠

Ready to Install?

Get started with this skill in seconds

openclaw install video-download-faas