Instagram Media Downloader
Downloads photos and videos from public Instagram posts, reels, and carousels using gallery-dl. Carousel posts are split into one file per image/video automatically — no special-casing needed.
Requirements
- Outbound internet access to instagram.com. This will NOT work in network-restricted sandboxes (e.g. some cloud Cowork/Claude Code environments block instagram.com by org policy) — if a request hangs or returns a connection/proxy error, tell the user this environment can't reach Instagram rather than retrying repeatedly.
gallery-dl(Python). Check first, install if missing:
(dropgallery-dl --version || pip install --upgrade gallery-dl --break-system-packages--break-system-packageson systems where pip doesn't require/support it)
Steps
Confirm the URL is a public Instagram post/reel/carousel, e.g.
https://www.instagram.com/p/XXXXXXXXX/orhttps://www.instagram.com/reel/XXXXXXXXX/. Private accounts/posts are out of scope for this skill (no login support).Pick an output directory. Default to
./instagram-downloads/<shortcode>(the shortcode is the id segment after/p/or/reel/in the URL) unless the user specifies a destination.Run gallery-dl:
gallery-dl --directory "<output_dir>" "<instagram_url>"- Single photo/video post → downloads one file.
- Carousel → gallery-dl walks every sidecar item and writes each as a separate numbered file (e.g.
..._1.jpg,..._2.jpg,..._3.mp4) in the same folder automatically. - Reels and video posts save as
.mp4.
If the command fails:
401/ login wall → the post is private or Instagram is demanding auth; this skill only handles public content — tell the user and stop.429/ rate limited → wait and retry, or add--sleep 5-15between requests for multiple URLs.- "Unsupported URL" / empty output with no clear error → Instagram changes its markup often and breaks scrapers; try
pip install -U gallery-dl --break-system-packagesfirst, since this is almost always an outdated extractor, not a bad URL.
Verify and report: list the output directory (
ls -la <output_dir>) and tell the user what was downloaded (file count, e.g. "3 images + 1 video from the carousel"). In Cowork, deliver the files with SendUserFile; on a local/CLI environment, just confirm the saved path.
Notes
- Only download content the user has the right to reuse (their own posts, or with explicit permission) — respect Instagram's Terms of Service and the original poster's rights, especially before reusing downloaded media elsewhere (e.g. in GuideMapper content).
- Out of scope: Stories and Highlights (expire, need login) and private accounts. If the user needs those, that's a separate, login-based extension of this skill.