Yt dlp

From vorojar/AgentClaw · View interactive version

Yt dlp is an AI agent skill from the GitHub repository vorojar/AgentClaw. 下载视频/音频(YouTube、B站、Twitter等)。不用于:网页抓取(用 web_fetch)、直播录制

How to use this skill

Skill file

All output files go to the working directory (工作目录). Always use auto_send: true on the shell call.

Filenames use video ID (ASCII-safe) to avoid encoding issues on Windows.

Download video (default: best quality mp4)

{"command": "yt-dlp --no-warnings -f 'bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4]/b' --merge-output-format mp4 -o '{WORKDIR}/%(id)s.%(ext)s' 'URL'", "timeout": 300000, "auto_send": true}

Download audio only (mp3)

{"command": "yt-dlp --no-warnings -x --audio-format mp3 --audio-quality 0 -o '{WORKDIR}/%(id)s.%(ext)s' 'URL'", "timeout": 300000, "auto_send": true}

Download with subtitles

{"command": "yt-dlp --no-warnings -f 'bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4]/b' --merge-output-format mp4 --write-auto-subs --write-subs --sub-langs 'zh.*,en' --embed-subs -o '{WORKDIR}/%(id)s.%(ext)s' 'URL'", "timeout": 300000, "auto_send": true}

List available formats (when user asks for specific quality)

{"command": "yt-dlp --no-warnings -F 'URL'", "timeout": 30000}

Then let user choose, download with -f FORMAT_ID.

Download specific resolution (e.g. 720p)

{"command": "yt-dlp --no-warnings -f 'bv*[height<=720][ext=mp4]+ba[ext=m4a]/b[height<=720][ext=mp4]/b' --merge-output-format mp4 -o '{WORKDIR}/%(id)s.%(ext)s' 'URL'", "timeout": 300000, "auto_send": true}

Bilibili (needs cookies for high quality)

If download fails with 403 or low quality, try with cookies:

{"command": "yt-dlp --no-warnings --cookies-from-browser chrome -f 'bv*+ba/b' --merge-output-format mp4 -o '{WORKDIR}/%(id)s.%(ext)s' 'URL'", "timeout": 300000, "auto_send": true}

Playlist (download all)

{"command": "yt-dlp --no-warnings -f 'bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4]/b' --merge-output-format mp4 -o '{WORKDIR}/%(playlist_id)s/%(playlist_index)03d-%(id)s.%(ext)s' --yes-playlist 'URL'", "timeout": 600000}

Playlists can be large — do NOT auto_send. Tell user the folder path instead.

YouTube cookies(必读)

YouTube 需要登录才能下载。yt-dlp 的 --cookies 会回写文件,所以必须用临时副本,保护原始文件不被覆盖。

Download time range (e.g. 4-5 minutes only)

在命令中加 --download-sections "*00:04:00-00:05:00"(替换为实际时间范围),直接下载指定片段,不要下载全视频再裁剪。

Rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.