Install
openclaw skills install @zitao666/instagram-downloader交互式下载 Instagram 用户内容(帖子/Reels/头像)。首次使用时会依次询问用户名、下载目录、Cookie路径、代理地址。
openclaw skills install @zitao666/instagram-downloader按顺序询问,不要跳步:
1️⃣ Instagram 用户名是什么?(不含 @)
2️⃣ 下载到哪个目录?(完整路径,如 D:\Downloads\Instagram)
3️⃣ Cookie 文件路径?(Netscape 格式,如 C:\Users\xxx\cookies_instagram.txt)
4️⃣ 代理地址?(可选,格式 http://host:port,留空则不使用代理)
收集完所有参数后,执行下载命令。
gallery-dl --proxy "<代理地址>" --cookies "<cookie文件路径>" -D "<目标目录>" "https://www.instagram.com/<用户名>/"
注意:代理地址如果用户留空,则去掉
--proxy参数
fafa.0816https://www.instagram.com/fafa.0816/D:\Instagram\fafa.0816/home/user/downloads/instagraminstagram/<用户名>/ 子目录yt-dlp --cookies-from-browser chrome --cookies "cookies_instagram.txt" "https://www.instagram.com/"
然后把 cookies_instagram.txt 路径告诉 agent。
sessionidcookies_instagram.txt:# Netscape HTTP Cookie File
.instagram.com TRUE / FALSE 1800000000 sessionid 你的sessionid值
.instagram.com TRUE / TRUE 1800000000 csrftoken 你的csrftoken值
http://127.0.0.1:7890| URL 类型 | 下载内容 | 命令后缀 |
|---|---|---|
https://www.instagram.com/<用户>/ | 全部(帖子+reels+头像) | 不加后缀 |
https://www.instagram.com/<用户>/posts/ | 仅图片帖子 | /posts/ |
https://www.instagram.com/<用户>/reels/ | 仅视频 | /reels/ |
https://www.instagram.com/<用户>/avatar/ | 头像 | /avatar/ |
https://www.instagram.com/p/<帖子ID>/ | 单个帖子 | 直接链接 |
假设用户回答:
fafa.0816D:\DownloadsC:\Users\栗子\cookies_instagram.txthttp://127.0.0.1:7890执行:
gallery-dl --proxy "http://127.0.0.1:7890" --cookies "C:\Users\栗子\cookies_instagram.txt" -D "D:\Downloads" "https://www.instagram.com/fafa.0816/"
输出会写入 D:\Downloads\instagram\fafa.0816\
| 工具 | 适用场景 | 注意 |
|---|---|---|
| gallery-dl | 首选,稳定支持 Instagram 全部类型 | 首选 |
| yt-dlp | 备选 | Instagram 支持已标为 broken |
| 错误 | 原因 | 解决 |
|---|---|---|
401 Unauthorized | Cookie 过期 | 重新获取 sessionid |
404 Not Found | 用户不存在或私密 | 确认用户名正确 |
HttpError 无权限 | Cookie 缺少必要字段 | 确保有 sessionid 和 csrftoken 两行 |
| SSL 警告 | 代理证书问题 | 加 --no-check-certificate(不推荐) |
发布前检查:
<代理地址> 占位<cookie文件路径> 占位<目标目录> 占位<用户名> 占位