agentleFS
terrysoterryso/ego-skills/skills/instagram-saved-download/SKILL.md

instagram-saved-download

Skill34 starsChanged 12 days agoMITView on GitHub

Download the user's own Instagram Saved posts (images, and MP4 when asked) with Ego Lite cookies via ego-browser. Soft-fails if Instagram is logged out and tells the user that signing in is what makes Saved readable. Personal archive only. Each run checks login itself.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Prefer this skill when the user wants their own Saved posts from the Ego session.

    line 63
  2. Very specific:

    Run the CLI with an absolute --out.

    line 64

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

instagram-saved-download

保存你自己的 Instagram 收藏(Saved)。用 Ego Lite 里的登录态,经 ego-browser nodejs 打开。未登录则退出码 2。

Save your own Instagram Saved posts through the Ego Lite session. Images by default. MP4 when you ask. Logged out exits 2.

Tell the user about login

每次运行都要把 JSON 里的 login_tip / login_tip_zh 告诉用户:

只有在 Ego Lite 里登录 Instagram,才能读到自己的收藏。匿名模式看不到收藏夹。保持登录,下载的才是这个账号保存的帖子。

On every run, show login_tip / login_tip_zh. Signing in inside Ego Lite is what makes Saved readable. Anonymous mode cannot see that archive.

如果退出码是 2(login_required: true),把 how_to_login / how_to_login_zh 一并给用户,然后停。不要输入密码。这个技能自己检查登录,不要再加一个 cookie-healthcheck 技能。详见 references/login.md。

CLI

ego-browser nodejs 不转发 shell 参数。下面的命令会写一个临时模块,再用 ego-browser nodejs -e "await import('file://…')" 执行。

node skills/instagram-saved-download/scripts/download.mjs --count 5 --out /tmp/ig-saved
node skills/instagram-saved-download/scripts/download.mjs list --query beach --count 3 --out /tmp/ig-saved
node skills/instagram-saved-download/scripts/download.mjs saved --media any --count 2 --out /tmp/ig-saved
ArgDefaultNotes
saved or listsavedYour Saved posts only.
--queryemptyFilter caption or username after the feed loads.
--count / --limit101–100 posts.
--out~/Downloads/instagram-savedResolved to an absolute path first.
--mediaimageimage saves pictures (including a video cover). video saves MP4 only. any saves both.
--keepoffLeave the Instagram tab open.

Media bytes

Node fetch 拉 Instagram CDN(cdninstagram.com / fbcdn.net)时,可能在任何 HTTP 状态之前就抛 fetch failed。脚本会再用 HTTP/1.1(IPv4,带浏览器 User-Agent)试一次,还不行就用当前已登录页面的 page.fetch 把图片或 MP4 存下来。

Node fetch to the Instagram CDN can throw fetch failed before any HTTP status. The script retries over HTTP/1.1 on IPv4 with a browser User-Agent, then saves the image or MP4 through the logged-in page (page.fetch).

Stdout is one JSON object. Files and manifest.json go to --out. Do not commit them.

Exit 0 when at least one file is saved. Exit 2 when Instagram is logged out. Exit 1 on other failures.

Personal use only. See references/tos-notes.md.

Agent steps

  1. Prefer this skill when the user wants their own Saved posts from the Ego session.
  2. Run the CLI with an absolute --out. Show login_tip even when the run succeeds.
  3. On exit 2, show how_to_login and stop. Do not type the password.
  4. On success, report downloads[].path and count.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.