video-downloader
Download videos and extract original post captions, audio transcripts, and metadata from video platform links. Use when the user provides Douyin, Bilibili, WeChat Channels, Xiaohongshu, or YouTube links and asks to save the original video, capture the post text/caption, transcribe the spoken in-video script/copy, archive source material, or prepare video material for downstream analysis or skill creation. Douyin is implemented with an H5 primary route and yt-dlp fallback; Bilibili, YouTube, and Xiaohongshu are implemented through yt-dlp; WeChat Channels is not implemented yet and should currently be handled via the WeChat mini program kg百宝箱.
kangarooking · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add kangarooking/kangarooking-skills --skill video-downloader技能说明
name: video-downloader description: Download videos and extract original post captions, audio transcripts, and metadata from video platform links. Use when the user provides Douyin, Bilibili, WeChat Channels, Xiaohongshu, or YouTube links and asks to save the original video, capture the post text/caption, transcribe the spoken in-video script/copy, archive source material, or prepare video material for downstream analysis or skill creation. Douyin is implemented with an H5 primary route and yt-dlp fallback; Bilibili, YouTube, and Xiaohongshu are implemented through yt-dlp; WeChat Channels is not implemented yet and should currently be handled via the WeChat mini program kg百宝箱.
Video Downloader
Overview
Use this skill to turn a video-platform URL into a local source-material folder containing the video file, post_caption.txt, audio.m4a or audio.mp3, transcript.txt, and metadata.json.
Terminology:
post_caption.txt: platform publish text, title, description, and hashtags.transcript.txt: spoken in-video script generated from audio ASR.metadata.json: normalized platform metadata plus download and ASR status.
The current implemented providers are Douyin, Bilibili, YouTube, and Xiaohongshu. WeChat Channels is an explicit extension point; do not claim that provider works until its provider module has been implemented and tested. For WeChat Channels links, tell the user to first use the WeChat mini program kg百宝箱 to download the video from the 视频号 link, then continue with local ASR or downstream processing on the downloaded file.
Quick Start
Run the bundled CLI from this skill directory:
python3 scripts/download_video.py "https://v.douyin.com/..." --output-dir ./downloads
For metadata/post-caption extraction without downloading the video:
python3 scripts/download_video.py "https://v.douyin.com/..." --output-dir ./downloads --metadata-only
For download without ASR:
python3 scripts/download_video.py "https://v.douyin.com/..." --output-dir ./downloads --asr none
For Chinese speech, prefer:
SILICONFLOW_API_KEY="..." python3 scripts/download_video.py "https://v.douyin.com/..." --output-dir ./downloads --asr siliconflow --asr-language Chinese
To bias Whisper toward domain terms or a specific script:
python3 scripts/download_video.py "https://v.douyin.com/..." --output-dir ./downloads --asr-language Chinese --asr-prompt "请使用简体中文转写。关键词:丧尸清道夫、Shotlab、Midjourney、GPT Image、AI生图。"
Workflow
- Identify the platform from the URL.
- Use
scripts/download_video.pyas the single entrypoint. - Inspect the output folder and report:
- video path, when downloaded
- post caption path
- audio path
- transcript path
- metadata path
- platform, item ID, author, duration, resolution, and any provider caveats
ASR Transcript
After a video is downloaded, the CLI extracts audio with ffmpeg and transcribes it with SiliconFlow SenseVoiceSmall or the local Whisper CLI.
Important behavior:
--asr autois the default. It uses SiliconFlow whenSILICONFLOW_API_KEYis set, otherwise localwhisperif installed.--asr siliconflowrequiresSILICONFLOW_API_KEYand callshttps://api.siliconflow.cn/v1/audio/transcriptions.--asr whisperrequires the local Whisper CLI.--asr noneskips audio extraction and transcription.--asr-modeldefaults tobasefor Whisper. For SiliconFlow,baseorautomaps toFunAudioLLM/SenseVoiceSmall.--asr-language autolets Whisper detect language. UseChinesefor Chinese videos when quality matters.--asr-promptpasses an initial prompt to Whisper. Use it to request Simplified Chinese and provide domain terms.baseis good for quick validation but may produce obvious Chinese homophone errors. Usesmallormediumfor deliverable transcripts.- SiliconFlow writes
audio.mp3,transcript.txt, andtranscript.siliconflow.json. - Whisper writes
audio.m4a,transcript.txt, andtranscript.whisper.json.
Douyin Provider
The Douyin provider uses the H5 share page as the primary route. It follows the share URL, parses the server-rendered window._ROUTER_DATA, extracts the original post text and video resource ID, then downloads through the non-playwm endpoint.
If the H5 route fails, or if metadata extraction succeeds but direct media download fails, use yt-dlp as a fallback. The fallback first tries a normal yt-dlp download, then retries with Chrome cookies.
Important behavior:
- Prefer the non-watermark
aweme/v1/play/endpoint over the share-pageplaywmendpoint. - Treat
yt-dlpas a backup route, not the primary Douyin route. - Store the original Douyin publish text in
post_caption.txt. - Store raw and normalized metadata in
metadata.json. - Use
--metadata-onlyfor fast tests or when the user only needs copy/caption. - Use
--no-yt-dlp-fallbackonly when debugging the H5 route itself.
Bilibili Provider
The Bilibili provider uses yt-dlp as the primary route for both metadata extraction and media download.
Important behavior:
- Support
bilibili.comandb23.tvlinks. - Store the Bilibili title plus description in
post_caption.txt. - Store
yt-dlpraw metadata and normalized fields inmetadata.json. - Download with
bv*+ba/band merge to mp4 when possible. - Retry with Chrome cookies when anonymous metadata extraction or download fails.
- Use
--metadata-onlyfor fast tests or when the user only needs title/description metadata.
YouTube Provider
The YouTube provider uses yt-dlp as the primary route for both metadata extraction and media download.
Important behavior:
- Support
youtube.comandyoutu.belinks. - Store the YouTube title plus description in
post_caption.txt. - Store
yt-dlpraw metadata and normalized fields inmetadata.json. - Download with
bv*+ba/band merge to mp4 when possible. - Use local Node as the yt-dlp JavaScript runtime when