cnfeat/top-pm-skills/instagram-post-downloader
Claude Code and agent skill by cnfeat/top-pm-skills
- community
Checking that the SKILL.md file is still in the repository.
Downloads and saves Instagram posts as high-resolution files. Use when asked to download, save, or archive an Instagram post, reel thumbnail, or carousel. Fetches images from Instagram's CDN, saves them into a named folder, and stitches carousel slides into a single PDF. Supports batch downloading of multiple URLs at once.
Install
npx vskill@latest install cnfeat/top-pm-skills/instagram-post-downloaderSKILL.md
The same SKILL.md was published earlier as cnfeat/top-pm-skills/instagram-post-downloader.
Instagram Post Downloader Skill
Downloads Instagram posts at full resolution from Instagram's CDN — no screenshots, no compression. Handles single images, carousels (multi-slide posts), and Reel cover images. For carousels, produces individual slide files plus a single stitched PDF. Supports batch URLs in one run.
PREREQUISITE — Domain Allowlist
Before this skill can fetch any media, you must add Instagram's CDN domain to Claude Code's allowlist:
Settings → Capabilities → Domain allowlist → Add:
Without this, all CDN fetch calls will be blocked. If you see a permission error when Claude attempts a fetch to cdninstagram.com, this is the fix.
Required Inputs
Claude will ask for these if not provided upfront:
| Input | Required | Notes | |
|---|---|---|---|
| Instagram post URL(s) | Yes | One per line, or comma-separated. https://www.instagram.com/p/XXXX/ or https://www.instagram.com/reel/XXXX/ format | |
| Output directory | No | Defaults to ./instagram-downloads/ in the current working directory | |
| PDF stitch for carousels | No | Defaults to yes — produces carousel.pdf alongside individual slides | |
| File naming prefix | No | Optional prefix added before slide filenames, e.g. brand_ → brand_slide_01.jpg |
Batch input example:
Output Structure
For each URL processed, Claude creates a folder named after the post caption (first 40 characters, sanitised — spaces become underscores, special characters stripped). If no caption is available, the folder is named after the post shortcode.
Single image post
Carousel post
Batch run (3 URLs)
metadata.txt format
Completion summary (printed to terminal)
How Claude Should Execute This Skill
Step 1 — Collect and validate inputs
- Accept the URL(s) from the user. If the user pastes a comma-separated list, split on commas. If they paste one per line, split on newlines.
- Validate each URL matches
instagram.com/p/,instagram.com/reel/, orinstagram.com/tv/. Flag malformed URLs before proceeding. - Confirm the output directory. If none provided, use
./instagram-downloads/and tell the user. - Ask about PDF stitching preference only if the user hasn't said either way. Default is yes.
Step 2 — For each URL: fetch the post page
Fetch the Instagram post page HTML:
Instagram frequently changes its API surface. Use this fallback chain in order:
Attempt A — JSON endpoint:
Parse the JSON response. Look for graphql.shortcode_media or data.shortcode_media.
Attempt B — Embed page (most reliable):
Fetch this page's HTML and extract og:image meta tags and any window.__additionalDataLoaded or window.__StaticData JSON blobs embedded in <script> tags.
Attempt C — oEmbed endpoint:
This returns thumbnail_url — useful for single images, but only gives the first frame for carousels.
Headers to include on all requests:
Step 3 — Extract CDN image URLs
From the fetched data, extract all high-resolution CDN URLs. Instagram CDN URLs follow these patterns:
For single image posts:
- Extract the single
display_urlor the largestdisplay_resourcesentry (pick the one with the highestconfig_width).
For carousel posts:
- Look for
edge_sidecar_to_children.edges[]in the JSON. Each edge has its ownnode.display_urlandnode.display_resources[]. - Iterate all edges in order. This determines slide numbering.
- Pick the highest-resolution variant from each slide's
display_resourcesarray.
For Reels:
- The cover image is extractable the same way as a single image.
- The video file itself requires a third-party tool (see Bonus section).
If JSON extraction fails, fall back to scraping <meta property="og:image"> tags from the page HTML — this gives at least one image URL (the first slide or only image).
Step 4 — Sanitise folder name
Build the folder name from the post caption:
- Take the first 40 characters of the caption.
- Strip all characters that are not alphanumeric, spaces, or hyphens.
- Replace spaces and hyphens with underscores.
- Lowercase the result.
- Strip leading/trailing underscores.
- If the result is empty (e.g. caption was all emoji), use the post shortcode instead.
Step 5 — Create output folder structure
If a folder with that name already exists (e.g. running the same URL twice), append the shortcode to avoid collision: folder_name_SHORTCODE.
Step 6 — Download each image file
For each CDN URL, download the file with a streaming GET request:
Name files:
- Single image:
image.jpg - Carousel slides:
slide_01.jpg,slide_02.jpg, ... (zero-padded to 2 digits, or 3 digits if >99 slides)
Detect file format from the Content-Type header or URL extension. Instagram serves JPEG for photos and may serve WebP in some cases — preserve the actual extension.
Step 7 — Stitch carousel PDF (if applicable)
After all slides are downloaded, stitch them into a single PDF using Pillow:
Save as carousel.pdf in the post folder. If Pillow is not installed, run pip install Pillow first — or instruct the user to do so.
Dependency check at start of skill:
Step 8 — Write metadata.txt
Write a metadata.txt file into the post folder with all extracted metadata:
Step 9 — Print completion summary
After processing all URLs, print the summary table to the terminal (format shown in Output Structure section above). Include:
- Total URLs attempted
- Posts successfully saved
- Total files written (images + PDFs separately)
- Any URLs that were skipped and the reason
Step 10 — Handle errors gracefully
| Error scenario | Action | |
|---|---|---|
| URL is not an Instagram URL | Skip with message: "Skipped — not an Instagram URL: [url]" | |
| Post is private or requires login | Skip with message: "Skipped — post is private or login required: [url]" | |
| CDN fetch returns 403/404 | Try alternate CDN URL if available; if none, skip slide and note in metadata | |
| Pillow not installed | Skip PDF stitching, save slides only, note in summary | |
| Network timeout | Retry once after 5 seconds; if still failing, skip and log | |
| Folder name collision | Append shortcode suffix to folder name | |
| Rate limiting (429) | Wait 10 seconds and retry; log if retry also fails |
Bonus — Downloading Instagram Reels (Video)
This skill covers images and carousel PDFs. For Reels video files, Claude Code cannot download video directly without a third-party tool, because Instagram's video CDN uses signed URLs and additional auth tokens.
Recommended approach for Reels:
Use yt-dlp, a maintained open-source tool:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking参考skill/pm-claude-skills-main/pm-claude-skills-main/skills/instagram-post-downloader/SKILL.md
Popularity
- Repository stars
- 53
- Repository forks
- 5
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/cnfeat/top-pm-skills/instagram-post-downloader)