cjl-x-download
Download images and videos from X (Twitter) posts to ~/Downloads. Use when user shares an X/Twitter link and wants to save media, or says '下载', 'download', '保存图片', '保存视频', or provides a x.com/twitter.com URL with intent to download media.
Best use case
cjl-x-download is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Download images and videos from X (Twitter) posts to ~/Downloads. Use when user shares an X/Twitter link and wants to save media, or says '下载', 'download', '保存图片', '保存视频', or provides a x.com/twitter.com URL with intent to download media.
Teams using cjl-x-download should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/cjl-x-download/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How cjl-x-download Compares
| Feature / Agent | cjl-x-download | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Download images and videos from X (Twitter) posts to ~/Downloads. Use when user shares an X/Twitter link and wants to save media, or says '下载', 'download', '保存图片', '保存视频', or provides a x.com/twitter.com URL with intent to download media.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agent for YouTube Script Writing
Find AI agent skills for YouTube script writing, video research, content outlining, and repeatable channel production workflows.
AI Agents for Marketing
Discover AI agents for marketing workflows, from SEO and content production to campaign research, outreach, and analytics.
AI Agents for Startups
Explore AI agent skills for startup validation, product research, growth experiments, documentation, and fast execution with small teams.
SKILL.md Source
# cjl-x-download
从 X (Twitter) 链接下载图片或视频到 ~/Downloads。
## 依赖
- `yt-dlp`(已安装)
## 执行流程
### 1. 解析输入
从用户输入中提取 X/Twitter URL。支持的格式:
- `https://x.com/user/status/123456`
- `https://twitter.com/user/status/123456`
- `https://mobile.twitter.com/user/status/123456`
- 带查询参数的 URL(yt-dlp 自动处理 `?s=20` 等追踪参数)
缩短链接(t.co)先解析:`curl -Ls -o /dev/null -w '%{url_effective}' "SHORT_URL"`
如果用户没有提供 URL,用 AskUserQuestion 要求提供。
### 2. 尝试直接下载(视频优先)
直接用 yt-dlp 下载,无需先探测:
```bash
yt-dlp -o "~/Downloads/%(uploader)s_%(id)s.%(ext)s" "URL"
```
如果成功(视频推文),完成。跳到步骤 4 汇报结果。
### 3. 视频下载失败时,提取图片
yt-dlp 对纯图片推文可能报错。此时用 `--dump-json` 提取图片 URL:
```bash
yt-dlp --dump-json "URL" 2>&1
```
**判断结果:**
- JSON 中有 `thumbnails` 数组 → 提取图片 URL
- JSON 为空或报错 `no video` → 推文无媒体,告知用户"该推文不包含可下载的图片或视频"
- 报错含 `login` / `authentication` → 需要登录(见故障排除)
- 其他错误 → 报告具体错误信息
**图片下载:**
从 JSON 的 `thumbnails` 数组提取所有图片 URL,替换 `name=small` 或 `name=medium` 为 `name=orig` 获取原图,然后逐一下载:
```bash
curl -L -o ~/Downloads/tweet_ID_1.jpg "https://pbs.twimg.com/media/xxx?format=jpg&name=orig"
curl -L -o ~/Downloads/tweet_ID_2.jpg "https://pbs.twimg.com/media/yyy?format=jpg&name=orig"
```
文件扩展名跟随 URL 中的 `format` 参数(jpg/png/webp)。
### 4. 汇报结果
下载完成后,用 `ls -lh` 列出已下载的文件:文件名、大小、路径。
## 故障排除
### 需要登录
yt-dlp 报错含 `login` / `Sign in` / `age-restricted` 时,加 `--cookies-from-browser chrome`:
```bash
yt-dlp --cookies-from-browser chrome -o "~/Downloads/%(uploader)s_%(id)s.%(ext)s" "URL"
```
### 推文无媒体
纯文字推文没有可下载的媒体。告知用户即可。Related Skills
chaoxing-download
Download PDF documents from Chaoxing (超星) contest/platform viewer URLs and convert to TXT. Use when user wants to download files from contestyd.chaoxing.com, 超星, or provides Chaoxing WPS viewer URLs with objectid parameters. Supports single or batch downloads with page count validation and automatic PDF-to-TXT conversion.
bing-keyword-image-downloader
当用户需要按关键词从 Bing 公开图片搜索结果中批量下载图片时使用。遇到类似“帮我从 Bing 按关键词下载 10 张图片”“批量抓取 Bing 图片”“按关键词保存 Bing 图片到本地”这类请求时,应主动使用这个 skill。它专门处理基于关键词的 Bing 图片搜索、分页收集候选链接、跳过失败源站并保存到本地目录的工作流。
download
Downloads YouTube videos to ~/Downloads. Use when user wants to download a YouTube video to their machine.
instagram-reel-downloader-whatsapp
Download an Instagram Reel via sssinstagram.com and return it as a WhatsApp-ready video file. Use when a reel URL is provided and yt-dlp is blocked or not preferred.
bilibili-downloader
Download videos, audio, subtitles, and covers from Bilibili using bilibili-api. Use when working with Bilibili content for downloading videos in various qualities, extracting audio, getting subtitles and danmaku, downloading covers, and managing download preferences.
youtube-audio-download
Download YouTube video audio and convert to MP3. Supports age-restricted videos with cookies.
scihub-paper-downloader
Get a PDF link from Sci-Hub for a DOI.
yt-dlp-downloader
Download videos from YouTube, Bilibili, Twitter, and thousands of other sites using yt-dlp. Use when the user provides a video URL and wants to download it, extract audio (MP3), download subtitles, or select video quality. Triggers on phrases like "下载视频", "download video", "yt-dlp", "YouTube", "B站", "抖音", "提取音频", "extract audio".
douyin-video-downloader
抖音视频下载工具 - 通过第三方解析服务实现无水印视频下载
scholar-paper-downloader
学术文献PDF批量下载工具,支持从多个学术网站(arXiv、PubMed、PMC、Semantic Scholar等)搜索和下载论文, 自动提取元数据、生成索引列表。优先从官方免费渠道下载,付费文献提供手动下载指引。
douyin-download
抖音无水印视频下载工具。当用户发送抖音视频链接时,自动解析并下载无水印版本,上传到云盘发给用户。 Use cases: - 用户发送抖音链接 - "下载这个视频" - "帮我保存抖音视频" - "解析抖音链接"
youtube-hq-downloader
Youtube Highest Quality Downloader - Download highest quality silent video and pure audio from YouTube, then merge into video with sound