video-downloader-enhanced
Download videos and extract original post captions, audio transcripts, and metadata from video platform links. Use when the user provides Douyin, Bilibili, WeChat Channels, Xiaohon…
SyanChen7
@syanchen7
Install
$ openclaw skills install @syanchen7/video-downloader-enhancedVideo 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.wav / audio.m4a / audio.mp3, transcript.txt, transcript.srt (whisper.cpp only), 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.
Output Folder Naming
Each download creates a folder with a human-readable name:
YY_MM_DD_标题摘要_平台_作者
Example: 26_07_27_AI做PPT零基础终极教程_抖音_木子不写代码
Rules:
- Date — video publish date preferred, falls back to download date. Format:
YY_MM_DD. - 标题摘要 — title trimmed to ≤40 characters; newlines, hashtags (
#), mentions (@), emoji removed. - 平台 — Chinese display name:
抖音/B站/YouTube/小红书. - 作者 — falls back to
未知作者when unavailable. - Dedup — if the folder already exists, appends the last 5 characters of the video ID.
- Internal file names (
post_caption.txt,metadata.json, etc.) are not affected.
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 with local whisper.cpp (recommended):
python3 scripts/download_video.py "https://v.douyin.com/..." --output-dir ./downloads --asr whisper_cpp --asr-language Chinese
For Chinese speech with cloud ASR:
SILICONFLOW_API_KEY="..." python3 scripts/download_video.py "https://v.douyin.com/..." --output-dir ./downloads --asr siliconflow --asr-language Chinese
To bias ASR 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
- SRT path (whisper.cpp and openai-whisper)
- 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. Four backends are available, selected via --asr.
Backend Options
| Backend | Description |
|---|---|
auto (default) | Auto-detect: whisper.cpp > openai-whisper > SiliconFlow |
whisper_cpp | Local whisper.cpp (whisper-cli), fastest on Apple Silicon |
whisper | Local openai-whisper Python CLI |
siliconflow | Cloud API via SiliconFlow SenseVoiceSmall |
none | Skip audio extraction and transcription entirely |
--asr auto Priority
When --asr auto (the default) is used, the backend is selected in this order:
- whisper.cpp — if
WHISPER_CPP_BINpoints to an executable file, orwhisper-cliis available on PATH, andWHISPER_CPP_MODELpoints to an existing model file. - openai-whisper — if the
whisperCLI is available on PATH. - SiliconFlow — if
SILICONFLOW_API_KEYis set in the environment. - If none of the above are available, an error is returned. No software is auto-installed.
whisper.cpp (--asr whisper_cpp)
The recommended local backend for best performance on Apple Silicon.
Environment variables:
WHISPER_CPP_BIN— optional explicit path towhisper-cli; when unset, search PATHWHISPER_CPP_MODEL— required path to a local GGML model file
export WHISPER_CPP_BIN="/path/to/whisper-cli"
export WHISPER_CPP_MODEL="/path/to/ggml-large-v3-turbo.bin"
Do not assume a platform-specific default path. No software is installed automatically.
Output artifacts:
audio.wav(16 kHz PCM)transcript.txttranscript.srt(subtitles with timestamps)transcript.whisper_cpp.json(metadata)
The model is always the file path, not a model name — --asr-model is ignored for whisper_cpp.
openai-whisper (--asr whisper)
Output artifacts:
audio.m4atranscript.txttranscript.srttranscript.whisper.json
SiliconFlow (--asr siliconflow)
Requires SILICONFLOW_API_KEY. Calls https://api.siliconflow.cn/v1/audio/transcriptions.
Output artifacts:
audio.mp3transcript.txttranscript.siliconflow.json
SiliconFlow does not currently provide an SRT file; srt_path is returned as null.
Result Contract
Every ASR result includes status, backend, model, language, audio_path,
transcript_path, srt_path, raw_json_path, and error. A selected backend
that fails returns status: failed; auto does not silently retry another
backend after transcription has started.
Common Options
--asr-language— Language for transcription, e.g.Chinese,zh,English,auto. Default:auto.--asr-model— Model name. Default:auto(whisper.cpp ignores this; openai-whisper defaults tobase; SiliconFlow maps toFunAudioLLM/SenseVoiceSmall).--asr-prompt— Initial prompt passed to the ASR engine. Use it to request Simplified Chinese output and provide domain terms.--asr-max-seconds— Debug limit: transcribe only the first N seconds of audio.
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 available.
- Retry with
--remote-components ejs:githubor Chrome cookies when the basic route fails. - Use
--metadata-onlyfor fast tests or when the user only needs title/description metadata.
Xiaohongshu Provider
The Xiaohongshu provider uses a three-tier download fallback:
- Anonymous yt-dlp — public download without any authentication (no cookies).
- Public direct URL — if metadata is available but anonymous yt-dlp can't download, extracts the highest-quality video stream URL from yt-dlp's formats metadata and downloads it via plain HTTP.
- Chrome cookies yt-dlp — last resort; requires local Chrome browser access.
Metadata extraction is always anonymous — cookies are never triggered just to get author info or metadata.
Important behavior:
- Support
xiaohongshu.com,xhslink.com, andxhslink.cnlinks. - Store the Xiaohongshu title plus note body in
post_caption.txt. - Store
yt-dlpraw metadata and normalized fields inmetadata.json. - Author nickname is taken from anonymous metadata; falls back to
未知作者when unavailable. - Remote assistant: if both public routes fail, reports "需要在电脑端授权 Chrome Cookie" immediately instead of hanging.
- Safety: no
cookies.txtis saved; cookie contents are never logged or included in output. metadata.jsonrecordsdownload.method,download.cookie_used,download.direct_url_source, anddownload.fallback_errorsfor full traceability.- Use
--metadata-onlyfor fast tests or when the user only needs title/note metadata.
WeChat Channels Provider
WeChat Channels is recognized but not implemented yet.
Current finding:
yt-dlpdoes not support the testedweixin.qq.com/sph/...share link.- The public web page can expose text, cover image, and QR-code flow, but did not expose a playable video URL in the tested case.
- Do not claim that this skill can directly download WeChat Channels videos until a provider has been implemented and tested.
Temporary workflow:
- Ask the user to open WeChat and search for the mini program
kg百宝箱. - In
kg百宝箱, paste the 视频号 video link and download the video there. - After the user has the downloaded video file locally, this skill can still be used for local ASR/transcript work if the file is passed through the ASR helper or a future local-file entrypoint.
Provider Extension Contract
Add new platforms by creating a module under scripts/providers/ and registering it in scripts/providers/__init__.py.
Each provider should expose:
PLATFORM: stable provider namesupports(url: str) -> boolfetch(url: str, output_root: Path, *, metadata_only: bool = False, **options) -> dict
Output folders should include the same artifact contract whenever possible:
metadata.jsonpost_caption.txtaudio.wav/audio.m4a/audio.mp3andtranscript.txtwhen ASR is enabledtranscript.srtwhen whisper.cpp ASR is enabled- video file when download is enabled
Reserved providers:
wechat_channels
When a reserved provider is detected but not implemented, say so plainly and do not fabricate a download result.
Safety
Download only material the user owns, has permission to download, or can lawfully archive for their intended use. Do not bypass DRM, paid access controls, private permissions, or platform restrictions for unauthorized redistribution.
Top skills in this category
Nano Banana Pro
@steipeteGenerate/edit images with Nano Banana Pro (Gemini 3 Pro Image). Use for image create/modify requests incl. edits. Supports text-to-image + image-to-image; 1K/2K/4K; use --input-image.
AdMapix
@fly0pantsAdMapix raw data layer for ad creatives, apps, rankings, downloads/revenue, and market metadata. Returns structured JSON from the AdMapix API; the calling ag...
YouTube Watcher
@michaelgatharaFetch and read transcripts from YouTube videos. Use when you need to summarize a video, answer questions about its content, or extract information from it.
SuperDesign
@mpociotExpert frontend design guidelines for creating beautiful, modern UIs. Use when building landing pages, dashboards, or any user interface.
Video Frames
@steipeteExtract frames or short clips from videos using ffmpeg.