
ljg-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.
- Installs
- 474
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/lijigang/ljg-skills --skill ljg-x-download- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads ljg-x-download automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
ljg-x-download
从 X (Twitter) 链接下载图片或视频到 ~/Downloads。
依赖
yt-dlp(已安装)
执行流程
1. 解析输入
从用户输入中提取 X/Twitter URL。支持的格式:
https://x.com/user/status/123456https://twitter.com/user/status/123456https://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 下载,无需先探测:
yt-dlp -o "~/Downloads/%(uploader)s_%(id)s.%(ext)s" "URL"
如果成功(视频推文),完成。跳到步骤 4 汇报结果。
3. 视频下载失败时,提取图片
yt-dlp 对纯图片推文可能报错。此时用 --dump-json 提取图片 URL:
yt-dlp --dump-json "URL" 2>&1
判断结果:
- JSON 中有
thumbnails数组 → 提取图片 URL - JSON 为空或报错
no video→ 推文无媒体,告知用户"该推文不包含可下载的图片或视频" - 报错含
login/authentication→ 需要登录(见故障排除) - 其他错误 → 报告具体错误信息
图片下载:
从 JSON 的 thumbnails 数组提取所有图片 URL,替换 name=small 或 name=medium 为 name=orig 获取原图,然后逐一下载:
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:
yt-dlp --cookies-from-browser chrome -o "~/Downloads/%(uploader)s_%(id)s.%(ext)s" "URL"
推文无媒体
纯文字推文没有可下载的媒体。告知用户即可。
FAQ
What does the ljg-x-download 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.
How do I install ljg-x-download?
Run npx skills add https://github.com/lijigang/ljg-skills --skill ljg-x-download in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/ljg-x-download/ (personal) or .claude/skills/ljg-x-download/ (project).
Which AI agents can use ljg-x-download?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is ljg-x-download safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains ljg-x-download?
It is published by lijigang in lijigang/ljg-skills. It has 474 recorded installs.
More from lijigang/ljg-skills
ljg-card
lijigang/ljg-skills
Content caster (铸). Transforms text into PNG through precise HTML typography and, when the mold needs it, generated raster imagery. Four molds: -l (default) long reading card, -f source-faithful full text, -c comic, -w whiteboard. USE WHEN user says '铸', 'cast', '做成图', '做成卡片', '做成海报', '原文排版', '全文卡片', '漫画', or '白板'.
ljg-paper
lijigang/ljg-skills
Explain research papers to readers without a specialist background: what the paper studies, what the authors contribute, how the findings follow, and what the evidence does not establish. USE WHEN the user shares an arXiv link, paper URL, PDF, local paper, or paper title, or asks to read, explain, analyze, or understand a paper. Defaults to a saved Markdown note. NOT FOR reproduction, formal peer review, benchmark tables, or literature surveys.
ljg-roundtable
lijigang/ljg-skills
一个议题,一场圆桌:主持人请来 3-5 位真实人物,定义开场,逐轮交锋, 每轮收一张 ASCII 结构图,用户用指令控节奏(可/止/深入此节/引入新人物), 散场后全文存入 Markdown 笔记。Use when user says "圆桌讨论", "圆桌", "roundtable", "辩论", or wants to explore a topic through multi-perspective structured debate.
ljg-writes
lijigang/ljg-skills
写作引擎。把一个观点写成可理解、可迁移、经得住反例的 1000-1500 字中文文章。USE WHEN 写文章 OR 优化思想内容 OR 展开观点 OR 改写成逻辑递进的中文。NOT FOR 普通摘要、事实查询或结构风洞(用 ljg-structure)。
ljg-learn
lijigang/ljg-skills
Deep concept anatomist that deconstructs any concept through 8 exploration dimensions (history, dialectics, phenomenology, linguistics, formalization, existentialism, aesthetics, meta-philosophy) and compresses insights into an epiphany. Use when user asks to explain, dissect, or deeply understand a concept, term, or idea. Triggers on '解剖概念', '概念解剖', 'explain concept', 'learn concept', '/ljg-learn'. Produces markdown output.
ljg-plain
lijigang/ljg-skills
Cognitive atom: Plain (白). Rewrites any content so a smart 12-year-old groks it. Structure-free — form follows content. Use when user says '白话说', '说人话', '解释一下', 'plain', 'grok'.
Popular marketing & seo skills
reddit-automation
flowkit-labs/skills
Find Reddit threads where people are genuinely asking for what you offer, then draft short, genuinely helpful replies — disclosing your affiliation honestly and naming your product only when it truly answers the question. Two moves: discovery — scan the right subreddits for real needs (recommendation asks, expressed pain, competitor mentions) and rank the few threads where you can actually help; drafting — write from real experience, respect each community's self-promo rules, and keep a human in the loop to review and post. This markets on Reddit the honest way: contribute value, disclose who you are, never astroturf. Distilled from the playbook behind doany.ai's Reddit agent. Triggers on "find reddit opportunities", "reddit marketing", "reddit automation", "reply on reddit for my product", "reddit community engagement", "reddit lead gen", or any ask to turn Reddit threads into genuine, disclosed marketing replies.
twitter-automation
101-skills/superpowers
Automate Twitter/X with posting, engagement, and user management via inference.sh CLI. Apps: x/post-tweet, x/post-create (with media), x/post-like, x/post-retweet, x/dm-send, x/user-follow. Capabilities: post tweets, schedule content, like posts, retweet, send DMs, follow users, get profiles. Use for: social media automation, content scheduling, engagement bots, audience growth, X API. Triggers: twitter api, x api, tweet automation, post to twitter, twitter bot, social media automation, x automation, tweet scheduler, twitter integration, post tweet, twitter post, x post, send tweet
twitter-automation
magentosh/superpowers
Automate Twitter/X with posting, engagement, and user management via inference.sh CLI. Apps: x/post-tweet, x/post-create (with media), x/post-like, x/post-retweet, x/dm-send, x/user-follow. Capabilities: post tweets, schedule content, like posts, retweet, send DMs, follow users, get profiles. Use for: social media automation, content scheduling, engagement bots, audience growth, X API. Triggers: twitter api, x api, tweet automation, post to twitter, twitter bot, social media automation, x automation, tweet scheduler, twitter integration, post tweet, twitter post, x post, send tweet
twitter-automation
qu-skills/superpowers
Automate Twitter/X with posting, engagement, and user management via inference.sh CLI. Apps: x/post-tweet, x/post-create (with media), x/post-like, x/post-retweet, x/dm-send, x/user-follow. Capabilities: post tweets, schedule content, like posts, retweet, send DMs, follow users, get profiles. Use for: social media automation, content scheduling, engagement bots, audience growth, X API. Triggers: twitter api, x api, tweet automation, post to twitter, twitter bot, social media automation, x automation, tweet scheduler, twitter integration, post tweet, twitter post, x post, send tweet
product-launch-video
heygen-com/hyperframes
Turn a product or marketing URL, pasted script, or brief into a product launch / promo video — SaaS promos, feature reveals, product demos, app and company launches. Use when the user wants to market, launch, promote, or reveal a product; the default for any commercial URL. Site tours / showcases of a website route here too — the brief carries the show-it-as-is intent. Unclear → /hyperframes.
twitter-automation
skills-shell/superpowers
Automate Twitter/X with posting, engagement, and user management via inference.sh CLI. Apps: x/post-tweet, x/post-create (with media), x/post-like, x/post-retweet, x/dm-send, x/user-follow. Capabilities: post tweets, schedule content, like posts, retweet, send DMs, follow users, get profiles. Use for: social media automation, content scheduling, engagement bots, audience growth, X API. Triggers: twitter api, x api, tweet automation, post to twitter, twitter bot, social media automation, x automation, tweet scheduler, twitter integration, post tweet, twitter post, x post, send tweet