twitter-video-downloader
X(Twitter)视频下载 — 粘贴 X(Twitter) 视频链接,一键解析返回无水印视频下载链接。当用户需要下载 X(Twitter) 视频、保存推特视频、获取 X 视频直链时使用。触发词:X视频下载、Twitter视频下载、推特视频下载、X视频解析、Twitter视频解析、下载推特视频。
Install
npx skills add https://github.com/redfox-data/redfox-community/tree/main/skills/twitter-video-downloader
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install redfox-data-redfox-community@llmmart
git clone https://github.com/redfox-data/redfox-community.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole redfox-data/redfox-community collection as a plugin from our marketplace. Git is the plain clone.
README
X(Twitter)视频下载 / twitter-video-downloader
简介
贴上 X(Twitter) 视频链接就能拿到无水印下载直链,复制到浏览器或下载工具就能保存,x.com 和 twitter.com 的链接都能认,不会让你折腾半天还下载到带水印的版本。
核心价值
- 贴链即得不费劲:贴上推文链接就能拿到视频下载直链,复制到浏览器或下载工具就能保存,不用装插件、不用开会员。
- 视频干净无水印:返回的都是无水印视频,收藏、二次创作都能直接拿去用。
- 两种域名都能认:x.com 和 twitter.com 的链接都能识别,手机分享链接、电脑网页链接贴过来都能解析。
- 结果一眼看清:资源类型、时长、下载链接、封面链接、内容描述分开展示,拿到手就知道该复制哪一个。
适用对象
- 🎬 创作者 / 剪辑师 — 快速保存 X 上的视频素材,用于二次创作
- 📚 内容收藏者 — 把喜欢的推特视频备份到本地,不怕原帖被删
- 🔍 运营 / 研究者 — 下载竞品或热点视频,慢慢分析
功能特性
核心功能
- 视频解析:粘贴 X(Twitter) 视频推文链接,一键解析出无水印视频下载链接。
- 信息完整:展示资源类型、时长、下载链接、封面链接,内容描述完整逐行展示不截断。
- 双域名支持:x.com 和 twitter.com 两种链接都能识别。
密钥获取与安全说明
- 本技能需要使用环境变量:
REDFOX_API_KEY。 REDFOX_API_KEY由 红狐 hub (https://redfox.hk) 提供。- 请前往 红狐 hub 注册账号,获取
REDFOX_API_KEY。 - 配置设备环境变量
REDFOX_API_KEY后使用本技能。 - 在提供密钥前,请先确认密钥来源、可用范围、有效期及是否支持重置/撤销。
- 禁止在代码、提示词、日志或输出文件中硬编码/明文暴露密钥。
使用指南
直接用自然语言描述需求,无需记忆命令。
常用说法速查
| 意图 | 示例话术 | 效果 |
|---|---|---|
| 下载 X 视频 | 「下载这个视频 https://x.com/user/status/xxxxx」 | 解析链接并返回视频下载直链 |
| 保存推特视频 | 「帮我把这条推特视频存下来」 | 引导你贴上链接,解析后返回下载链接 |
输出示例
解析完成后,你将收到如下格式的结果:
✅ 解析成功!
📝 内容描述:推文原文完整展示
🎬 资源列表: 类型、时长、下载链接、封面链接一一列出
复制链接到浏览器或下载工具即可下载。
使用场景
| 场景 | 角色 | 示例问法 | 收益 |
|---|---|---|---|
| 素材收集 | 剪辑师 | 「下载这条 X 视频」 | 快速拿到无水印素材,直接进剪辑流程 |
| 内容备份 | 收藏者 | 「保存这个推特视频」 | 原帖删除也不怕,本地永久留存 |
| 热点分析 | 运营 | 「把这个爆款视频下下来」 | 离线反复观看,拆解爆款逻辑 |
Skill manifest
X(Twitter)视频下载
通过 redfox.hk API 解析 X(Twitter) 视频链接,直接返回无水印视频下载链接。
能力概述
- 平台支持:X(Twitter)
- 内容类型:视频(mp4 下载直链)
- 输入方式:粘贴 X(Twitter) 视频推文链接即可(每次仅限一个链接,不支持批量上传)
- 输出结果:直接返回视频下载链接,复制到浏览器或下载工具即可保存
使用方式
示例命令
下载 X(Twitter) 视频:
python3 "$SKILL_PATH/scripts/downloader.py" "https://x.com/user/status/xxxxx"
首次使用
先配置 API Key,然后运行:
# 设置环境变量
export REDFOX_API_KEY=ak_你的密钥
# 解析视频,获取下载链接
python3 "$SKILL_PATH/scripts/downloader.py" "https://x.com/user/status/xxxxx"
前往 redfox.hk 注册获取 API Key。
后续使用
配置方式(任选其一):
| 方式 | 命令 |
|---|---|
| 环境变量(推荐) | export REDFOX_API_KEY=ark_你的密钥 |
| 命令行参数 | python3 "$SKILL_PATH/scripts/downloader.py" "<链接>" --api-key ark_你的密钥 |
| 配置文件 | echo '{"api_key":"ark_你的密钥"}' > ~/.qoder/apis/redfox.json |
特色功能
| 功能 | 说明 |
|---|---|
| 无水印直链 | API 自动返回无水印视频下载链接,无需手动处理 |
| 即贴即解析 | 粘贴推文链接即可,无需额外操作 |
| 链接自适应 | 支持 x.com 与 twitter.com 两种域名链接 |
| 结果直出 | 解析完成直接返回下载链接,复制即可用 |
常见使用场景
| 场景 | 示例链接 | 说明 |
|---|---|---|
| 保存 X 上的视频 | https://x.com/user/status/xxxxx |
获取无水印视频下载链接 |
| 推特视频离线收藏 | https://twitter.com/user/status/xxxxx |
解析后复制链接下载保存 |
| 内容二次创作 | 任意 X 视频链接 | 下载素材用于剪辑创作 |
| 素材备份 | 任意 X 视频链接 | 备份喜欢的视频到本地 |
支持的作品链接格式
| 平台 | 链接格式 | 示例 |
|---|---|---|
| X(Twitter) | https://x.com/<用户名>/status/<推文ID> |
PC 网页链接 / 手机分享链接 |
| X(Twitter) | https://twitter.com/<用户名>/status/<推文ID> |
旧域名链接 |
常见问题
Q:如何获取自己的 API Key? A:前往 redfox.hk 注册即可获取 Token。
Q:下载的视频有水印吗? A:没有。API 返回的是无水印视频直链。
Q:可以批量上传多个链接吗? A:不支持。每次只能输入一个链接,批量上传会导致解析失败。
Q:链接提示解析失败怎么办? A:确认链接是否完整、推文是否仍然存在、账号内容是否公开。私密账号或已删除推文无法解析。
了解更多
本工具基于 redfox.hk 的 parseWork/videoDownload/x 接口构建。前往官网查看更多 API 能力和使用文档。
Files (redfox-community)
-
scripts
-
downloader.py 8.1 KB
#!/usr/bin/env python3 """ X(Twitter)视频下载 - API 版本 使用 redfox.hk API 解析 X(Twitter) 视频链接,直接返回无水印视频下载链接 Usage: python3 downloader.py <url> [--api-key <key>] """ import argparse import json import os import sys import warnings from pathlib import Path import requests # Suppress urllib3 OpenSSL warning on macOS warnings.filterwarnings("ignore", category=Warning) warnings.filterwarnings("ignore", message=".*NotOpenSSLWarning.*") API_URL = "https://redfox.hk/story/api/parseWork/videoDownload/x" CONFIG_DIR = Path.home() / ".qoder" / "apis" CONFIG_FILE = CONFIG_DIR / "redfox.json" ENV_KEY = "REDFOX_API_KEY" GREEN = "\033[92m" YELLOW = "\033[93m" RED = "\033[91m" CYAN = "\033[96m" BOLD = "\033[1m" RESET = "\033[0m" def info(msg): print(f"{GREEN}[✓]{RESET} {msg}") def warn(msg): print(f"{YELLOW}[!]{RESET} {msg}") def error(msg): print(f"{RED}[✗]{RESET} {msg}") def step(msg): print(f"{CYAN}[→]{RESET} {msg}") def get_api_key(cli_key=None): """Get API key with priority: CLI arg > env var > config file.""" if cli_key: return cli_key env_key = os.environ.get(ENV_KEY) if env_key: return env_key if CONFIG_FILE.exists(): try: data = json.loads(CONFIG_FILE.read_text()) key = data.get("api_key") if key: return key except (json.JSONDecodeError, OSError): pass return None def save_api_key(api_key): """Persist API key to config file.""" CONFIG_DIR.mkdir(parents=True, exist_ok=True) CONFIG_FILE.write_text(json.dumps({"api_key": api_key}, indent=2)) os.chmod(CONFIG_FILE, 0o600) # secure file permissions info(f"API Key saved to {CONFIG_FILE}") def extract_download_url(data): """Extract video download URL from API response data (tolerant of field naming).""" if isinstance(data, str): return data if not isinstance(data, dict): return None # Common field names that may carry the downloadable video link candidate_keys = [ "videoUrl", "video_url", "downloadUrl", "download_url", "videoDownloadUrl", "video_download_url", "playUrl", "play_url", "url", "link", ] for key in candidate_keys: value = data.get(key) if isinstance(value, str) and value.startswith(("http://", "https://")): return value # Nested structures: data.video.url / data.media[0].url etc. for nested_key in ("video", "media", "result", "detail"): nested = data.get(nested_key) found = extract_download_url(nested) if isinstance(nested, (dict, list)) else None if found: return found if isinstance(data.get("videos"), list): for item in data["videos"]: found = extract_download_url(item) if found: return found return None def main(): parser = argparse.ArgumentParser( description="X(Twitter)视频下载 - 使用 redfox.hk API 解析视频并返回下载链接", formatter_class=argparse.RawDescriptionHelpFormatter, epilog=""" Examples: python3 downloader.py https://x.com/user/status/xxxxx python3 downloader.py https://x.com/user/status/xxxxx --api-key ark_xxxxx 也可通过环境变量 REDFOX_API_KEY 配置密钥: export REDFOX_API_KEY=ark_xxxxx python3 downloader.py <url> """, ) parser.add_argument("url", help="X(Twitter) 视频链接,如 https://x.com/user/status/xxxxx") parser.add_argument("--api-key", help="API Key(格式 ark_xxx,不传则读取环境变量或配置文件)") parser.add_argument( "--save-key", action="store_true", help="将本次传入的 API Key 保存到配置文件", ) parser.add_argument( "--json", action="store_true", help="以 JSON 格式输出完整返回结果", ) args = parser.parse_args() # ── Banner ── banner = f"""{CYAN}{BOLD} ╔══════════════════════════════════════╗ ║ X(Twitter) Video Downloader ║ ║ X(Twitter)视频下载 ║ ╚══════════════════════════════════════╝{RESET} """ print(banner) # ── API Key ── api_key = get_api_key(cli_key=args.api_key) if not api_key: error("未找到 API Key,请设置环境变量 REDFOX_API_KEY 或使用 --api-key 参数") print(f" 获取 Key: https://redfox.hk/settings/api-keys?source=github") sys.exit(1) # Save key if requested if args.save_key: save_api_key(api_key) # ── URL ── url = args.url.strip().strip('"').strip("'") if not url.startswith(("http://", "https://")): url = "https://" + url step(f"URL: {url}") # ── Call API ── step("Calling redfox.hk API...") session = requests.Session() session.headers.update({ "Content-Type": "application/json", "X-API-KEY": api_key, }) try: resp = session.post(API_URL, json={"url": url, "source": "twitter/X视频下载-GitHub"}, timeout=30) result = resp.json() except requests.exceptions.RequestException as e: error(f"API request failed: {e}") sys.exit(1) except json.JSONDecodeError: error(f"API returned invalid JSON: {resp.text[:200]}") sys.exit(1) code = result.get("code") msg = result.get("msg", "") # 成功 code 以 2 开头(如 200、2000),其余为错误 if not str(code).startswith("2"): if code == 3106: error("缺少 API Key") elif code == 3107: error("API Key 无效或已失效,请检查是否正确") print(" 配置方式:export REDFOX_API_KEY=ark_你的密钥") elif code == 400: error(f"请求参数错误: {msg}") else: error(f"API error (code {code}): {msg}") sys.exit(1) data = result.get("data") if not data: error("API returned empty data") sys.exit(1) # ── Parse result ── if args.json: print(json.dumps(data, ensure_ascii=False, indent=2)) desc = data.get("desc") if isinstance(data, dict) else None cover = data.get("cover") if isinstance(data, dict) else None resources = data.get("resources") if isinstance(data, dict) else None print(f"\n{GREEN}{BOLD}✓ 解析成功!{RESET}") # 内容描述(完整原文,不截断) if desc: print(f"\n{CYAN}{BOLD}📝 内容描述:{RESET}") for line in str(desc).splitlines(): print(f" {line}") # 资源列表:类型 / 时长 / 下载链接 / 封面链接 if isinstance(resources, list) and resources: print(f"\n{CYAN}{BOLD}🎬 资源列表(共 {len(resources)} 个):{RESET}") for i, res in enumerate(resources, 1): if not isinstance(res, dict): continue rtype = res.get("type") or "未知" dl = res.get("downloadUrl") or "-" cu = res.get("coverUrl") or cover or "-" dur = res.get("durationSeconds") dur_str = f"{dur} 秒" if isinstance(dur, (int, float)) and dur else "未知" print(f"\n {BOLD}【资源 {i}】{RESET}") print(f" 资源类型:{rtype}") print(f" 时长:{dur_str}") print(f" 下载链接:{dl}") print(f" 封面链接:{cu}") else: # 回退:无 resources 字段时从顶层提取 download_url = extract_download_url(data) if not download_url: error("未能从 API 返回结果中提取下载链接,原始返回如下:") print(json.dumps(data, ensure_ascii=False, indent=2)) sys.exit(1) print(f"\n{CYAN}{BOLD}🎬 资源:{RESET}") print(f" 下载链接:{download_url}") if cover: print(f" 封面链接:{cover}") print(f"\n{CYAN}复制链接到浏览器或下载工具即可下载。{RESET}") sys.exit(0) if __name__ == "__main__": main()
-
-
README.en.md 3.3 KB
# X(Twitter) Video Downloader / twitter-video-downloader --- ## Introduction Paste an X(Twitter) video link and get a watermark-free download URL instantly. Copy it into your browser or download tool to save — both x.com and twitter.com links are supported, and you won't end up with a watermarked version. **Core Value** - **Paste and go**: paste a tweet link and get a video download URL right away — copy into your browser or download tool, no plugins or subscriptions needed. - **Clean, watermark-free**: every returned video is watermark-free, ready for collecting or remixing. - **Both domains recognized**: x.com and twitter.com links both work — mobile share links and desktop URLs alike. - **Results at a glance**: resource type, duration, download link, cover link, and full description are all laid out clearly so you know exactly what to copy. **Who Is It For** - 🎬 **Creators / Editors** — quickly save video clips from X for secondary creation - 📚 **Content Collectors** — back up favorite Twitter videos locally, safe from deleted posts - 🔍 **Operators / Researchers** — download competitor or trending videos for analysis --- ## Features ### Core Features - **Video Parsing**: paste an X(Twitter) video tweet link to parse out the watermark-free video download URL. - **Complete Information**: displays resource type, duration, download link, cover link, and full description line by line without truncation. - **Dual Domain Support**: recognizes both x.com and twitter.com links. --- ## API Key & Security - This skill requires the environment variable: `REDFOX_API_KEY`. - `REDFOX_API_KEY` is provided by [RedFoxHub](https://redfox.hk/settings/api-keys?source=github) (`https://redfox.hk`). - Please register at [RedFoxHub](https://redfox.hk?source=github) to obtain your `REDFOX_API_KEY`. - Configure the `REDFOX_API_KEY` environment variable on your device before using this skill. - Before providing your key, confirm its source, scope, validity period, and whether it can be reset/revoked. - Never hardcode or expose the key in code, prompts, logs, or output files. --- ## Usage Guide Just describe what you want in natural language — no commands to memorize. ### Quick Reference | Intent | Example | Result | | ------ | ------- | ------ | | Download an X video | "Download this video https://x.com/user/status/xxxxx" | Parses the link and returns a direct video download URL | | Save a Twitter video | "Help me save this Twitter video" | Prompts you to paste the link, then returns the download URL | ### Output Example After parsing, you will receive a result like: > ✅ Parsed successfully! > > 📝 Description: the full tweet text shown in its entirety > > 🎬 Resources: > type, duration, download link, and cover link listed one by one > > Copy the link into your browser or download tool to download. --- ## Use Cases | Scenario | Role | Example | Benefit | | -------- | ---- | ------- | ------- | | Material collection | Editor | "Download this X video" | Get watermark-free footage straight into your editing workflow | | Content backup | Collector | "Save this Twitter video" | Keep it locally forever, even if the original post is deleted | | Trend analysis | Operator | "Download this viral video" | Watch offline repeatedly and break down what makes it viral | -
README.md 3.1 KB
# X(Twitter)视频下载 / twitter-video-downloader --- ## 简介 贴上 X(Twitter) 视频链接就能拿到无水印下载直链,复制到浏览器或下载工具就能保存,x.com 和 twitter.com 的链接都能认,不会让你折腾半天还下载到带水印的版本。 **核心价值** - **贴链即得不费劲**:贴上推文链接就能拿到视频下载直链,复制到浏览器或下载工具就能保存,不用装插件、不用开会员。 - **视频干净无水印**:返回的都是无水印视频,收藏、二次创作都能直接拿去用。 - **两种域名都能认**:x.com 和 twitter.com 的链接都能识别,手机分享链接、电脑网页链接贴过来都能解析。 - **结果一眼看清**:资源类型、时长、下载链接、封面链接、内容描述分开展示,拿到手就知道该复制哪一个。 **适用对象** - 🎬 **创作者 / 剪辑师** — 快速保存 X 上的视频素材,用于二次创作 - 📚 **内容收藏者** — 把喜欢的推特视频备份到本地,不怕原帖被删 - 🔍 **运营 / 研究者** — 下载竞品或热点视频,慢慢分析 --- ## 功能特性 ### 核心功能 - **视频解析**:粘贴 X(Twitter) 视频推文链接,一键解析出无水印视频下载链接。 - **信息完整**:展示资源类型、时长、下载链接、封面链接,内容描述完整逐行展示不截断。 - **双域名支持**:x.com 和 twitter.com 两种链接都能识别。 --- ## 密钥获取与安全说明 - 本技能需要使用环境变量:`REDFOX_API_KEY`。 - `REDFOX_API_KEY` 由 [红狐 hub](https://redfox.hk/settings/api-keys?source=github) (`https://redfox.hk`) 提供。 - 请前往 [红狐 hub](https://redfox.hk?source=github) 注册账号,获取 `REDFOX_API_KEY`。 - 配置设备环境变量 `REDFOX_API_KEY` 后使用本技能。 - 在提供密钥前,请先确认密钥来源、可用范围、有效期及是否支持重置/撤销。 - 禁止在代码、提示词、日志或输出文件中硬编码/明文暴露密钥。 --- ## 使用指南 直接用自然语言描述需求,无需记忆命令。 ### 常用说法速查 | 意图 | 示例话术 | 效果 | | ---- | -------- | ---- | | 下载 X 视频 | 「下载这个视频 https://x.com/user/status/xxxxx」 | 解析链接并返回视频下载直链 | | 保存推特视频 | 「帮我把这条推特视频存下来」 | 引导你贴上链接,解析后返回下载链接 | ### 输出示例 解析完成后,你将收到如下格式的结果: > ✅ 解析成功! > > 📝 内容描述:推文原文完整展示 > > 🎬 资源列表: > 类型、时长、下载链接、封面链接一一列出 > > 复制链接到浏览器或下载工具即可下载。 --- ## 使用场景 | 场景 | 角色 | 示例问法 | 收益 | | ---- | ---- | -------- | ---- | | 素材收集 | 剪辑师 | 「下载这条 X 视频」 | 快速拿到无水印素材,直接进剪辑流程 | | 内容备份 | 收藏者 | 「保存这个推特视频」 | 原帖删除也不怕,本地永久留存 | | 热点分析 | 运营 | 「把这个爆款视频下下来」 | 离线反复观看,拆解爆款逻辑 | -
SKILL.md 3.6 KB
--- name: twitter-video-downloader description: X(Twitter)视频下载 — 粘贴 X(Twitter) 视频链接,一键解析返回无水印视频下载链接。当用户需要下载 X(Twitter) 视频、保存推特视频、获取 X 视频直链时使用。触发词:X视频下载、Twitter视频下载、推特视频下载、X视频解析、Twitter视频解析、下载推特视频。 --- # X(Twitter)视频下载 通过 [redfox.hk](https://redfox.hk/settings/api-keys?source=github) API 解析 X(Twitter) 视频链接,直接返回无水印视频下载链接。 --- ## 能力概述 - **平台支持**:X(Twitter) - **内容类型**:视频(mp4 下载直链) - **输入方式**:粘贴 X(Twitter) 视频推文链接即可(每次仅限一个链接,不支持批量上传) - **输出结果**:直接返回视频下载链接,复制到浏览器或下载工具即可保存 --- ## 使用方式 ### 示例命令 下载 X(Twitter) 视频: ```bash python3 "$SKILL_PATH/scripts/downloader.py" "https://x.com/user/status/xxxxx" ``` ### 首次使用 先配置 API Key,然后运行: ```bash # 设置环境变量 export REDFOX_API_KEY=ak_你的密钥 # 解析视频,获取下载链接 python3 "$SKILL_PATH/scripts/downloader.py" "https://x.com/user/status/xxxxx" ``` > 前往 [redfox.hk](https://redfox.hk/settings/api-keys?source=github) 注册获取 API Key。 ### 后续使用 配置方式(任选其一): | 方式 | 命令 | |------|------| | **环境变量**(推荐) | `export REDFOX_API_KEY=ark_你的密钥` | | **命令行参数** | `python3 "$SKILL_PATH/scripts/downloader.py" "<链接>" --api-key ark_你的密钥` | | **配置文件** | `echo '{"api_key":"ark_你的密钥"}' > ~/.qoder/apis/redfox.json` | --- ## 特色功能 | 功能 | 说明 | |------|------| | **无水印直链** | API 自动返回无水印视频下载链接,无需手动处理 | | **即贴即解析** | 粘贴推文链接即可,无需额外操作 | | **链接自适应** | 支持 x.com 与 twitter.com 两种域名链接 | | **结果直出** | 解析完成直接返回下载链接,复制即可用 | --- ## 常见使用场景 | 场景 | 示例链接 | 说明 | |------|----------|------| | 保存 X 上的视频 | `https://x.com/user/status/xxxxx` | 获取无水印视频下载链接 | | 推特视频离线收藏 | `https://twitter.com/user/status/xxxxx` | 解析后复制链接下载保存 | | 内容二次创作 | 任意 X 视频链接 | 下载素材用于剪辑创作 | | 素材备份 | 任意 X 视频链接 | 备份喜欢的视频到本地 | ### 支持的作品链接格式 | 平台 | 链接格式 | 示例 | |------|----------|------| | X(Twitter) | `https://x.com/<用户名>/status/<推文ID>` | PC 网页链接 / 手机分享链接 | | X(Twitter) | `https://twitter.com/<用户名>/status/<推文ID>` | 旧域名链接 | --- ## 常见问题 **Q:如何获取自己的 API Key?** A:前往 [redfox.hk](https://redfox.hk/settings/api-keys?source=github) 注册即可获取 Token。 **Q:下载的视频有水印吗?** A:没有。API 返回的是无水印视频直链。 **Q:可以批量上传多个链接吗?** A:不支持。每次只能输入一个链接,批量上传会导致解析失败。 **Q:链接提示解析失败怎么办?** A:确认链接是否完整、推文是否仍然存在、账号内容是否公开。私密账号或已删除推文无法解析。 --- ## 了解更多 本工具基于 [redfox.hk](https://redfox.hk/settings/api-keys?source=github) 的 `parseWork/videoDownload/x` 接口构建。前往官网查看更多 API 能力和使用文档。
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.