youtube-downloader
下载具有可自定义质量和格式选项的 YouTube 视频。当用户要求下载、保存或抓取 YouTube 视频时,请使用此技能。支持各种质量设置(最佳、1080p、720p、480p、360p)、多种格式(mp4、webm、mkv)以及仅音频下载为 MP3。
安装 / 下载方式
TotalClaw CLI推荐
totalclaw install totalclaw:totalclaw~wells1137-yt-video-downloadercURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~wells1137-yt-video-downloader/file -o wells1137-yt-video-downloader.md# 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 --- ## 中文说明 # YouTube 视频下载器 下载 YouTube 视频,并可完全控制质量和格式设置。 ## 快速开始 下载视频最简单的方式: ```bash python scripts/download_video.py "https://www.youtube.com/watch?v=VIDEO_ID" ``` 这会以最佳可用质量将视频下载为 MP4,保存到 `/mnt/user-data/outputs/`。 ## 选项 ### 质量设置 使用 `-q` 或 `--quality` 指定视频质量: - `best`(默认):可用的最高质量 - `1080p`:全高清 - `720p`:高清 - `480p`:标清 - `360p`:较低质量 - `worst`:可用的最低质量 示例: ```bash python scripts/download_video.py "URL" -q 720p ``` ### 格式选项 使用 `-f` 或 `--format` 指定输出格式(仅适用于视频下载): - `mp4`(默认):兼容性最好 - `webm`:现代格式 - `mkv`:Matroska 容器 示例: ```bash python scripts/download_video.py "URL" -f webm ``` ### 仅音频 使用 `-a` 或 `--audio-only` 仅将音频下载为 MP3: ```bash python scripts/download_video.py "URL" -a ``` ### 自定义输出目录 使用 `-o` 或 `--output` 指定不同的输出目录: ```bash python scripts/download_video.py "URL" -o /path/to/directory ``` ## 完整示例 1. 以 1080p MP4 下载视频: ```bash python scripts/download_video.py "https://www.youtube.com/watch?v=dQw4w9WgXcQ" -q 1080p ``` 2. 仅下载音频为 MP3: ```bash python scripts/download_video.py "https://www.youtube.com/watch?v=dQw4w9WgXcQ" -a ``` 3. 以 720p WebM 下载到自定义目录: ```bash python scripts/download_video.py "https://www.youtube.com/watch?v=dQw4w9WgXcQ" -q 720p -f webm -o /custom/path ``` ## 工作原理 此技能使用 `yt-dlp`——一个强大的 YouTube 下载器,它会: - 在未安装时自动安装自身 - 在下载前获取视频信息 - 选择符合你条件的最佳可用流 - 在需要时合并视频流和音频流 - 支持各种 YouTube 视频格式 ## 重要说明 - 下载内容默认保存到 `/mnt/user-data/outputs/` - 视频文件名根据视频标题自动生成 - 脚本会自动处理 yt-dlp 的安装 - 仅下载单个视频(默认跳过播放列表) - 更高质量的视频可能需要更长的下载时间并占用更多磁盘空间