视频下载
Download source media only. Do not transcribe, rewrite, edit, or publish it.
Storage rules
- Keep source URLs, source titles, source metadata, and downloaded reference media inside
01-内容生产/视频工作台/.internal/ by default.
- Use
01-内容生产/视频工作台/制作中/<日期-主题>/原始素材/ only when the caller explicitly names a production project and the media is an approved production input.
- Never place source information in a handoff, finished script, final archive, or public document.
- Never overwrite an existing file. Let the downloader add a stable suffix or stop.
Workflow
- Confirm that the URL is source media and that downloading it is within the user's request.
- Run the bundled downloader. It uses this order:
- Douyin: TikHub media URL, then
yt-dlp with browser cookies, then plain yt-dlp.
- Other supported sites: plain
yt-dlp, optionally with browser cookies when required.
- Inspect the returned local path and media probe. A successful HTTP response alone is not delivery.
- Require a playable audio or video stream and a non-zero duration. Report the local path, duration, dimensions, and selected download method.
- If every route fails, preserve the concise failure log and state the missing prerequisite. Do not claim that the video was downloaded.
Command
Use the Python interpreter that can import tikhub for the best Douyin path. In this workspace, prefer /opt/homebrew/bin/python3 when available.
/opt/homebrew/bin/python3 scripts/download_media.py '<url>'
Useful options:
# Explicit production input directory
/opt/homebrew/bin/python3 scripts/download_media.py '<url>' --output-dir '01-内容生产/视频工作台/制作中/<日期-主题>/原始素材/<项目>'
# Extract audio only
/opt/homebrew/bin/python3 scripts/download_media.py '<url>' --audio-only
# Use an authenticated browser profile for a protected public page
/opt/homebrew/bin/python3 scripts/download_media.py '<url>' --cookies-from-browser chrome
Resolve scripts/download_media.py relative to this SKILL.md; do not assume the current directory is the skill directory.
Safety and failure handling
- Use browser cookies only for the requested public media. Do not print, copy, or persist raw cookies.
- Read
TIKHUB_API_KEY from the environment or the workspace-root .env; never print it.
- Do not bypass private-account access controls, paywalls, DRM, or deleted/private media.
- Treat TikHub and browser cookies as acquisition fallbacks, not as proof that reuse rights exist.
- Keep the original source file untouched after download.
- If
ffprobe fails, reject the file even if it has an .mp4 extension.
Handoff
Return a compact result containing:
- local media path
- source metadata path
- method used (
tikhub, yt-dlp-cookie, or yt-dlp)
- duration, resolution, and codecs
- any limitation such as watermark, missing audio, or authentication failure
Then route onward only when requested: ra-逐字稿提取skill for source speech extraction, video-use for editing, or ra-video-production-director for production.
1---2name: ra-video-download3description: Download source video or audio from Douyin, YouTube, Bilibili, Twitter/X, Xiaohongshu, and other yt-dlp-supported URLs into the content-creation workspace. Use when the user says 下载视频, 下载音频, 保存这个链接, 把源视频拉下来, or when another video workflow needs a local source file before transcription, frame analysis, editing, reference replication, or archiving.4---56# 视频下载78Download source media only. Do not transcribe, rewrite, edit, or publish it.910## Storage rules1112- Keep source URLs, source titles, source metadata, and downloaded reference media inside `01-内容生产/视频工作台/.internal/` by default.13- Use `01-内容生产/视频工作台/制作中/<日期-主题>/原始素材/` only when the caller explicitly names a production project and the media is an approved production input.14- Never place source information in a handoff, finished script, final archive, or public document.15- Never overwrite an existing file. Let the downloader add a stable suffix or stop.1617## Workflow18191. Confirm that the URL is source media and that downloading it is within the user's request.202. Run the bundled downloader. It uses this order:21 - Douyin: TikHub media URL, then `yt-dlp` with browser cookies, then plain `yt-dlp`.22 - Other supported sites: plain `yt-dlp`, optionally with browser cookies when required.233. Inspect the returned local path and media probe. A successful HTTP response alone is not delivery.244. Require a playable audio or video stream and a non-zero duration. Report the local path, duration, dimensions, and selected download method.255. If every route fails, preserve the concise failure log and state the missing prerequisite. Do not claim that the video was downloaded.2627## Command2829Use the Python interpreter that can import `tikhub` for the best Douyin path. In this workspace, prefer `/opt/homebrew/bin/python3` when available.3031```bash32/opt/homebrew/bin/python3 scripts/download_media.py '<url>'33```3435Useful options:3637```bash38# Explicit production input directory39/opt/homebrew/bin/python3 scripts/download_media.py '<url>' --output-dir '01-内容生产/视频工作台/制作中/<日期-主题>/原始素材/<项目>'4041# Extract audio only42/opt/homebrew/bin/python3 scripts/download_media.py '<url>' --audio-only4344# Use an authenticated browser profile for a protected public page45/opt/homebrew/bin/python3 scripts/download_media.py '<url>' --cookies-from-browser chrome46```4748Resolve `scripts/download_media.py` relative to this `SKILL.md`; do not assume the current directory is the skill directory.4950## Safety and failure handling5152- Use browser cookies only for the requested public media. Do not print, copy, or persist raw cookies.53- Read `TIKHUB_API_KEY` from the environment or the workspace-root `.env`; never print it.54- Do not bypass private-account access controls, paywalls, DRM, or deleted/private media.55- Treat TikHub and browser cookies as acquisition fallbacks, not as proof that reuse rights exist.56- Keep the original source file untouched after download.57- If `ffprobe` fails, reject the file even if it has an `.mp4` extension.5859## Handoff6061Return a compact result containing:6263- local media path64- source metadata path65- method used (`tikhub`, `yt-dlp-cookie`, or `yt-dlp`)66- duration, resolution, and codecs67- any limitation such as watermark, missing audio, or authentication failure6869Then route onward only when requested: `ra-逐字稿提取skill` for source speech extraction, `video-use` for editing, or `ra-video-production-director` for production.