Video Download FaaS — Video 下载 FaaS
v1.0.0下载 videos in MP4 格式化 using yt-dlp with FaaS (Firecracker/ContAIner) isolation. 启动 下载s, 检查 状态, and kill processes. Videos are automatically converted to MP4 格式化.
运行时依赖
安装命令
点击复制技能文档
Video 下载 FaaS
下载 videos a同步hronously using yt-dlp in isolated background processes. All 下载s are saved as MP4 files.
Overview
This 技能 manages video 下载s as background tasks that:
启动 immediately and return control to the user Continue 运行ning even if the 会话 disconnects Can be 监控ed for 进度 Can be terminated when needed When to Use
Use this 技能 when:
下载ing large videos that take time Processing multiple videos concurrently 运行ning 下载s on remote/headless 系统s Need to continue working while 下载ing Quick 启动 启动 a 下载 scripts/下载.sh "https://youtube.com/watch?v=..."
Returns immediately with:
会话 ID Process ID (PID) 记录 file location 检查 状态 # 列出 all active 下载s scripts/检查-状态.sh
# 检查 specific 下载 scripts/检查-状态.sh video_dl_1234567890_12345
Kill 下载 # Graceful 停止 scripts/kill-下载.sh video_dl_1234567890_12345
# Force kill scripts/kill-下载.sh video_dl_1234567890_12345 --force
Commands 下载.sh
启动 a video 下载 in background with MP4 输出 格式化.
Usage:
下载.sh [输出_directory]
Parameters:
URL - Video URL to 下载 (required) 输出_directory - Where to save video (optional, default: ~/下载s)
输出 格式化:
下载s are automatically converted to MP4 格式化 Uses best avAIlable MP4 video + M4A audio, merged into MP4 If source isn't MP4, it will be re-encoded to MP4
Returns:
会话 ID for 追踪ing PID for process management Paths to 记录 and 会话 files
Example:
scripts/下载.sh "https://www.youtube.com/watch?v=dQw4w9WgXcQ" /tmp/videos
检查-状态.sh
检查 下载 进度 and 状态.
Usage:
# 列出 all 会话s 检查-状态.sh
# 检查 specific 会话 检查-状态.sh <会话_id>
Returns:
Process 状态 (运行ning/completed) 下载 进度 (if 运行ning) 下载ed files (if completed) Error in格式化ion (if fAIled) kill-下载.sh
Terminate a 运行ning 下载.
Usage:
kill-下载.sh <会话_id> [--force]
Parameters:
会话_id - The 会话 ID from 下载.sh --force - Use SIGKILL instead of SIGTERM 会话 Management
会话 files are stored in /tmp/ with 格式化:
video_dl_{timestamp}_{pid}.会话 - 会话 metadata video_dl_{timestamp}_{pid}.pid - Process ID video_dl_{timestamp}_{pid}.记录 - 下载 记录
会话s are automatically 清理ed up when:
下载 completes 成功fully Process is killed via kill-下载.sh FaaS Integration
For contAInerized/Firecracker execution:
# 运行 下载 in isolated contAIner ./运行-in-contAIner.sh scripts/下载.sh "URL"
# 检查 from host scripts/检查-状态.sh
Troubleshooting
下载 not 启动ing:
检查 yt-dlp is 安装ed: yt-dlp --version 验证 URL is 访问ible: curl -I "URL"
Process not found:
会话 may have completed and auto-清理ed 检查 ~/下载s for finished files
权限 denied:
Ensure scripts are executable: chmod +x scripts/*.sh Requirements yt-dlp 安装ed and in PATH Bash 4.0+ Write 访问 to /tmp and 输出 directory