Instagram Gallery Download
Use this skill to run gallery-dl for Instagram post/carousel URLs in /p/ form.
Quick Start
- Use the helper script for consistent defaults:
scripts/download_instagram_gallery.sh 'https://www.instagram.com/p/<code>/'
- For login-required content, pass browser cookies:
scripts/download_instagram_gallery.sh '<instagram-url>' --cookies-browser chrome
Execution Context
Always run this skill in escalation permission mode.
Required for every invocation:
sandbox_permissions:"require_escalated"- Run
gallery-dlcommands outside the Codex sandbox (escalated permissions).
Workflow
- Validate URL shape:
- Supported:
https://www.instagram.com/p/<code>/ - Not supported by this skill:
.../reel/...and.../reels/...(route toyt-dlp)
- Supported:
- Choose output folder (default: current directory).
- Run the helper script with
sandbox_permissions: "require_escalated". - Verify output files and
.jsonmetadata sidecars.
Command Patterns
Recommended - with cookies
Instagram often blocks direct downloads with redirect to login page. Always use browser cookies:
- Basic:
scripts/download_instagram_gallery.sh 'https://www.instagram.com/p/POST_ID/'
- With cookies:
scripts/download_instagram_gallery.sh 'https://www.instagram.com/p/POST_ID/' --cookies-browser chrome
- Pass-through gallery-dl flags:
scripts/download_instagram_gallery.sh 'https://www.instagram.com/p/POST_ID/' -- -R 2 --sleep 1-3
Routing Rule
- If URL matches
instagram.com/reel/<code>/orinstagram.com/reels/<code>/, use theyt-dlpskill instead of this skill.
It enables:
- tag text files
- JSON metadata sidecars
- archive tracking file (
.gallery-dl-archive.sqlite3) to reduce duplicates
Troubleshooting
- Redirect to login page:
- Retry with
--cookies-browserusing a logged-in browser profile.
- Retry with
- No new downloads:
- Expected when archive tracking sees already-downloaded items.
- Use a new output directory if re-download is required.
- Rate limiting:
- Add delay/retry flags via pass-through options (after
--).
- Add delay/retry flags via pass-through options (after
Resources
- Script runner:
scripts/download_instagram_gallery.sh - Extra examples/options:
references/gallery-dl-instagram.md