download-video
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDownload Video (agent-first)
下载视频(Agent优先)
Turn a social post URL into a downloadable video. The whole flow is one hosted
API call — no browser, no login, no watermark, no yt-dlp install. It returns
direct CDN MP4 URLs for every quality (up to 1080p) plus author/caption/metadata,
and can stream the file straight to disk.
将社交帖子链接转换为可下载的视频。整个流程只需一次托管API调用——无需浏览器、无需登录、无水印、无需安装yt-dlp。它会返回所有画质(最高1080p)的CDN直接MP4链接,以及作者/标题/元数据,还可直接将文件流式传输到磁盘。
When to use
使用场景
- User pastes a Twitter/X, TikTok, Instagram, or YouTube post link and wants the video, the MP4 URL, a GIF, or the images.
- User says "download / save / grab / rip this video", "get the highest quality", "download without watermark", or "just give me the direct link".
- An agent needs a video file (or its CDN URL) to feed into another step.
- 用户粘贴Twitter/X、TikTok、Instagram或YouTube的帖子链接,想要获取视频、MP4链接、GIF或图片。
- 用户说出“下载/保存/获取/提取这个视频”“获取最高画质”“无水印下载”或“直接给我链接”。
- Agent需要视频文件(或其CDN链接)用于后续步骤。
How it works (routing)
工作原理(路由)
There is one host per platform, and each host serves only its own platform.
The helper script detects the platform from the URL and routes automatically —
you normally don't pick the host yourself:
| Platform | Host |
|---|---|
| Twitter / X | |
| TikTok | |
| |
| YouTube | |
Sending a TikTok link to the Twitter host returns — always match
the link to its platform host (the script does this for you).
INVALID_URL每个平台对应一个独立的主机,每个主机仅服务对应的平台。辅助脚本会从链接中检测平台并自动路由——通常无需手动选择主机:
| 平台 | 主机 |
|---|---|
| Twitter / X | |
| TikTok | |
| |
| YouTube | |
将TikTok链接发送到Twitter主机会返回——务必确保链接与对应平台的主机匹配(脚本会自动完成此操作)。
INVALID_URLStep 1 — The fast path (script)
步骤1 — 快速路径(脚本)
bash
scripts/dl.sh <post-url> [options]- — download the best-quality MP4 into the current dir, using the server-provided filename (
scripts/dl.sh <url>).<handle>-<id>-<quality>.mp4 - — print compact metadata + the list of available qualities (run this first if the user wants a specific resolution — labels differ per post).
--info - — print the full result JSON (every media item and variant URL).
--json - — pick a specific variant label (falls back to best if that label isn't offered for this post).
--quality 720p - — pick the Nth media item in a multi-photo/video post.
--n 2 - (a dir) or
--out ./clips/(a file) — where to save.--out ./clip.mp4 - (or
--key <KEY>env) — API key for higher limits (see Limits).DXV_API_KEY - — hit a specific deployment; skips routing.
--host http://localhost:3000
Examples:
bash
undefinedbash
scripts/dl.sh <post-url> [options]- — 将最佳画质MP4下载到当前目录,使用服务器提供的文件名(
scripts/dl.sh <url>)。<handle>-<id>-<quality>.mp4 - — 打印简洁元数据+可用画质列表(如果用户需要特定分辨率,建议先运行此命令——不同帖子的画质标签可能不同)。
--info - — 打印完整结果JSON(所有媒体项和版本链接)。
--json - — 选择特定版本标签(如果该帖子不提供此标签,则自动 fallback 到最佳画质)。
--quality 720p - — 选择多图/视频帖子中的第N个媒体项。
--n 2 - (目录)或
--out ./clips/(文件)——指定保存位置。--out ./clip.mp4 - (或
--key <KEY>环境变量)——用于提升调用限制的API密钥(参见限制部分)。DXV_API_KEY - — 指定特定部署地址;跳过路由。
--host http://localhost:3000
示例:
bash
undefinedBest quality, into ./
最佳画质,下载到当前目录
scripts/dl.sh "https://x.com/SpaceX/status/1732824684683784516"
scripts/dl.sh "https://x.com/SpaceX/status/1732824684683784516"
See what's available first, then grab 720p into a folder
先查看可用选项,再将720p画质视频下载到指定文件夹
scripts/dl.sh "https://www.tiktok.com/@user/video/1234567890" --info
scripts/dl.sh "https://www.tiktok.com/@user/video/1234567890" --quality 720p --out ./clips/
scripts/dl.sh "https://www.tiktok.com/@user/video/1234567890" --info
scripts/dl.sh "https://www.tiktok.com/@user/video/1234567890" --quality 720p --out ./clips/
Just the direct MP4 URLs, no download (pipe to jq etc.)
仅获取直接MP4链接,不下载(可通过管道传递给jq等工具)
scripts/dl.sh "https://www.instagram.com/reel/Cxyz/" --json
The script needs only `curl`. `jq` or `python3`, if present, make `--json`/`--info`
output pretty and handle URL-encoding — but it degrades gracefully without them.scripts/dl.sh "https://www.instagram.com/reel/Cxyz/" --json
该脚本仅依赖`curl`。如果存在`jq`或`python3`,可让`--json`/`--info`的输出更美观,并处理URL编码——但即使没有这些工具,脚本也能正常运行。Step 2 — Or call the API directly
步骤2 — 直接调用API
No script needed — it's a plain HTTP API. Two endpoints per host:
GET|POST /api/extractbash
curl "https://download-twitter-video.drummerduck.com/api/extract?url=<POST_URL>"无需脚本——这是一个普通HTTP API。每个主机包含两个端点:
GET|POST /api/extractbash
curl "https://download-twitter-video.drummerduck.com/api/extract?url=<POST_URL>"POST form:
POST表单方式:
curl -X POST -H "content-type: application/json"
-d '{"url":"<POST_URL>"}'
https://download-twitter-video.drummerduck.com/api/extract
-d '{"url":"<POST_URL>"}'
https://download-twitter-video.drummerduck.com/api/extract
Response: `{ "ok": true, "data": { source, id, url, author{name,handle,avatar},
text, createdAt, thumbnail, engine, media: [ { type, poster, durationMs, width,
height, variants: [ { quality, width, height, bitrate, container, mimeType, url,
size } ] } ] } }`. Variants are sorted best-first; `url` is a direct CDN link.
**`GET /api/download`** → streams the actual file as an attachment (this is what
`dl.sh` uses). Params: `url` (required), `quality` (optional label), `n`
(optional media index):
```bash
curl -OJ "https://download-tktk-video.drummerduck.com/api/download?url=<POST_URL>&quality=720p"Errors come back as —
(wrong platform or unparseable), (post has no video),
(see below), , , .
{ "ok": false, "error": { "code", "message" } }INVALID_URLNO_MEDIARATE_LIMITEDBLOCKEDUPSTREAM_ERRORINTERNALcurl -X POST -H "content-type: application/json"
-d '{"url":"<POST_URL>"}'
https://download-twitter-video.drummerduck.com/api/extract
-d '{"url":"<POST_URL>"}'
https://download-twitter-video.drummerduck.com/api/extract
响应格式:`{ "ok": true, "data": { source, id, url, author{name,handle,avatar},
text, createdAt, thumbnail, engine, media: [ { type, poster, durationMs, width,
height, variants: [ { quality, width, height, bitrate, container, mimeType, url,
size } ] } ] } }`。版本按画质从优到劣排序;`url`为CDN直接链接。
**`GET /api/download`** → 将实际文件作为附件流式传输(`dl.sh`脚本即使用此端点)。参数:`url`(必填)、`quality`(可选标签)、`n`(可选媒体项索引):
```bash
curl -OJ "https://download-tktk-video.drummerduck.com/api/download?url=<POST_URL>&quality=720p"错误响应格式为——包括(错误平台或无法解析链接)、(帖子无视频)、(参见下文)、、、。
{ "ok": false, "error": { "code", "message" } }INVALID_URLNO_MEDIARATE_LIMITEDBLOCKEDUPSTREAM_ERRORINTERNALStep 3 — Or wire it as an MCP server
步骤3 — 接入为MCP服务器
Each host also exposes a streamable-HTTP MCP server at . Add the one(s)
you need:
/api/mcpjson
{
"mcpServers": {
"twitter-video": { "type": "http", "url": "https://download-twitter-video.drummerduck.com/api/mcp" },
"tiktok-video": { "type": "http", "url": "https://download-tktk-video.drummerduck.com/api/mcp" },
"instagram-video":{ "type": "http", "url": "https://download-instagram-video.drummerduck.com/api/mcp" },
"youtube-video": { "type": "http", "url": "https://download-youtube-video.drummerduck.com/api/mcp" }
}
}Tools (named per platform): (full media + URLs),
(metadata only), and (mint a key).
extract_<platform>_videoget_<platform>_infoget_free_api_key每个主机还在路径提供可流式传输的HTTP MCP服务器。按需添加所需服务器:
/api/mcpjson
{
"mcpServers": {
"twitter-video": { "type": "http", "url": "https://download-twitter-video.drummerduck.com/api/mcp" },
"tiktok-video": { "type": "http", "url": "https://download-tktk-video.drummerduck.com/api/mcp" },
"instagram-video":{ "type": "http", "url": "https://download-instagram-video.drummerduck.com/api/mcp" },
"youtube-video": { "type": "http", "url": "https://download-youtube-video.drummerduck.com/api/mcp" }
}
}工具(按平台命名):(完整媒体+链接)、(仅元数据)和(生成密钥)。
extract_<platform>_videoget_<platform>_infoget_free_api_keyLimits & API keys
限制与API密钥
- Anonymous: ~30 requests/hour per IP.
- Free key: ~300/hour, 2000/day. Mint one (no signup) and reuse it:
Save the returned key (shown once) and send it asbash
curl -X POST -H "content-type: application/json" -d '{"label":"my-bot"}' \ https://download-twitter-video.drummerduck.com/api/keys(orAuthorization: Bearer <KEY>), or exportX-API-Key: <KEY>for the script.DXV_API_KEYis self-documenting and, with a key, reports that key's tier/limits.GET /api/keys - Rate-limit state is on /
x-ratelimit-limit/x-ratelimit-remainingresponse headers; ax-ratelimit-reseterror includesRATE_LIMITED.retry-after
- 匿名用户:每IP约30次请求/小时。
- 免费密钥:约300次/小时,2000次/天。无需注册即可生成并重复使用:
保存返回的密钥(仅显示一次),并通过bash
curl -X POST -H "content-type: application/json" -d '{"label":"my-bot"}' \ https://download-twitter-video.drummerduck.com/api/keys(或Authorization: Bearer <KEY>)发送,或为脚本设置X-API-Key: <KEY>环境变量。DXV_API_KEY可自行查看文档,使用密钥时会返回该密钥的等级/限制信息。GET /api/keys - 速率限制状态包含在响应头/
x-ratelimit-limit/x-ratelimit-remaining中;x-ratelimit-reset错误会包含RATE_LIMITED字段。retry-after
Verify
验证
- Confirm the saved file exists and is non-trivial in size, or that the printed variant URLs resolve.
- If the user wanted a specific resolution, check first — available quality labels (e.g.
--info,1080p,720p) vary per post; an unavailable label silently falls back to best.360p - Report which platform host was used and the quality actually downloaded.
- 确认保存的文件存在且大小合理,或打印的版本链接可正常访问。
- 如果用户需要特定分辨率,先查看的结果——可用画质标签(如
--info、1080p、720p)因帖子而异;若标签不可用,会自动 fallback 到最佳画质。360p - 告知用户使用的平台主机以及实际下载的画质。
Provenance
来源
- Public hosted API — no auth required to extract:
- ,
GET|POST /api/extract,GET /api/download, MCP atPOST /api/keys— on the four/api/mcphosts above.download-*-video.drummerduck.com
- Built from the private source project (the Next.js app behind these hosts). This skill calls only the public website API — it contains no private source, keys, or internal endpoints.
mewc/download-x-video
- 公开托管API——提取操作无需授权:
- 、
GET|POST /api/extract、GET /api/download以及POST /api/keys路径的MCP服务器——均部署在上述四个/api/mcp主机上。download-*-video.drummerduck.com
- 基于私有源项目构建(即这些主机背后的Next.js应用)。本工具仅调用公开网站API——不包含任何私有源码、密钥或内部端点。
mewc/download-x-video