Ig downloader skill
Download Instagram profile media (reels MP4, photos JPG, full carousel multi-image JPG) via sessionid (instagrapi), Apify dataset fallback, or interactive setup wizard. No password sharing required.From its SKILL.md
npx -y skills add CripterHack/ig-downloader-skillAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as GPL-2.0. That is the authorβs claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
14.5 KB, ~3.9k tokens by cl100k_base, as published. Nobody here has run it
Instagram Downloader Skill v2.2
Purpose: Download all media (reels MP4, carousels with ALL images, photos JPG) from an Instagram profile. Three operation modes: sessionid (cookie, recommended), Apify (no login, limited), setup wizard (Playwright browser).
β 2026-07-07:
--loginmode is BROKEN. Meta deprecated the instagrapi login endpoint server-side. The--login,--password, and--totpflags exist but return 404. Use--setup(Playwright) or a manual--sessionidcookie instead.
Operation Modes
graph LR
subgraph Sessionid[Mode 1: Sessionid π₯]
direction TB
S1[sessionid cookie] --> S2[login_by_sessionid]
S2 --> S3[user_id_from_username]
S3 --> S4[user_medias β ALL posts]
S4 --> S5[photo_download / video_download]
S5 --> S6[π YYYY-MM-DD/shortcode/]
end
subgraph Apify[Mode 2: Apify]
direction TB
A1[Apify Actor Dataset] --> A2[toon-file or --dataset API]
A2 --> A3{GQL available?}
A3 -->|Yes <4w| A4[β
All carousel images]
A3 -->|No >4w| A5[β First image only]
end
subgraph Setup[Mode 3: Setup Wizard]
direction TB
U1[--setup flag] --> U2[Playwright Chromium]
U2 --> U3[User logs in]
U3 --> U4[Extract sessionid]
U4 --> U5[πΎ Save to config.json]
end
Mode Comparison
| Aspect | Sessionid π₯ | Apify (legacy) | Setup Wizard |
|---|---|---|---|
| Authentication | Cookie sessionid | None | Playwright browser |
| All posts (any date) | β Yes | β Yes | N/A (setup only) |
| Carousels: ALL images | β Yes | β 1st image only (old posts) | N/A |
| Carousels: recent only | β Yes | β GQL enhancement | N/A |
| Private profiles | β (if you follow) | β | N/A |
| No watermark reels | β Yes | β Yes (Apify) | N/A |
| Session persistence | β config.json | N/A | β config.json |
| Setup time | 1 min (first time) | 5 min (Apify account) | 30s (one-time) |
| Cost | $0 | ~$0.03/run | $0 |
Architecture
Credential Resolution Priority
The script auto-detects credentials in this order:
--sessionidCLI flag β one-shot session cookie (highest priority)SESSIONIDenvironment variable β for CI/automation- Config file (
~/.ig-downloader/config.json) β persistent, set by--setup - Chrome cookies β automatic extraction from browser SQLite (if logged in)
When no sessionid is found β falls to --setup (interactive) or Apify mode
(if dataset provided).
β The
--loginmode (and itssettings.jsonpersistence) is BROKEN. Meta deprecated the login endpoint. All auth must use sessionid or --setup.
Mode 1: Sessionid (Recommended)
flowchart LR
COOKIE[sessionid cookie] --> LOGIN[login_by_sessionid]
LOGIN --> UID[user_id_from_username]
UID --> MEDIAS[user_medias<br/>amount=0 β ALL posts]
MEDIAS --> TYPE{media_type}
TYPE -->|1: Photo| PHOTO[photo_download β .jpg]
TYPE -->|2: Video| REEL[video_download β .mp4]
TYPE -->|8: Carousel| CAR[media_info β resources[]]
CAR --> IMG1[_01.jpg]
CAR --> IMG2[_02.jpg]
CAR --> IMGN[_0N.jpg]
PHOTO --> DIR[π YYYY-MM-DD/shortcode/]
REEL --> DIR
IMG1 --> DIR
DIR --> INFO[+ post_info.txt]
Mode 2: Apify (Fallback)
Same as v1.x: Apify Actor β dataset β toon file β download (with GQL carousel enhancement for recent posts).
Interactive Setup
flowchart TD
A[Run: ig-downloader --setup] --> B{Playwright installed?}
B -->|Yes| C[Launch Chromium browser]
C --> D[Navigate to instagram.com]
D --> E[User logs in]
E --> F[Poll context.cookies every 3s]
F --> G{sessionid detected?}
G -->|No| F
G -->|Yes| H[Save to config.json]
H --> I[Close browser β
]
B -->|No| J{Chrome DB accessible?}
J -->|Yes| K[DPAPI + AES-GCM decrypt]
K --> L{File locked?}
L -->|No| M[Extract sessionid]
L -->|Yes| J
M --> H
J -->|No| N[Prompt user: paste sessionid manually]
N --> O[Save to config.json]
O --> I
Prerequisites
- Python 3.7+
instagrapi >= 2.0.0:pip install instagrapirequests:pip install requests- Chrome (optional, for interactive setup and cookie extraction)
- Apify account (free tier, only needed for Apify legacy mode)
Getting the Sessionid Cookie
Method A: Manual (1 minute)
- Open Chrome, go to
https://www.instagram.com - Log in to Instagram
- Press F12 β Application β Cookies β
www.instagram.com - Find
sessionidβ copy its value - Run:
python instagram_downloader.py -u username --sessionid "YOUR_SESSIONID"
Method B: Interactive Setup (recommended)
python instagram_downloader.py --setup
This opens Instagram in your browser. Log in, and the script automatically detects the sessionid cookie, saves it to ~/.ig-downloader/config.json, and exits. After that, no --sessionid flag needed.
Method C: Environment Variable
set SESSIONID=YOUR_SESSIONID
python instagram_downloader.py -u username
Workflow
Sessionid Mode (Recommended, Full Access)
# One-time setup (Playwright browser β logs in β saves cookie)
python instagram_downloader.py --setup
# Then just download β sessionid auto-loaded from config
python instagram_downloader.py -u username -o ./downloads
# Or pass cookie directly (one-shot, no config needed)
python instagram_downloader.py -u username --sessionid "1234..." -o ./downloads
Apify Mode (No Login)
# Via MCP
await mcp_call-actor({ actor: "unseenuser/IG-posts", input: { usernames: ["username"] } })
await mcp_get-dataset-items({ datasetId: "<ID>", limit: 999, clean: true })
# Then download
python instagram_downloader.py --toon-file ./data.txt \
-u username \
--date-start YYYY-MM-DD --date-end YYYY-MM-DD \
-o ./instagram_downloads
Script Reference
Location: instagram_downloader.py (same directory)
Command-Line Options
Mode Selection (auto-detected in order: login β sessionid β Apify β setup)
| Option | Description |
|---|---|
--sessionid STR | Instagram sessionid cookie (one-shot, overrides config/env). Recommended auth method. |
--setup | Interactive setup: Playwright β Chrome β manual paste. Saves to config. |
--login | β BROKEN β Meta deprecated the endpoint. Do NOT use. |
--password STR | β BROKEN β part of --login mode. |
--totp CODE | β BROKEN β part of --login mode. |
--setup | Interactive setup: opens browser, polls for login, saves sessionid to config. |
--dataset ID | Apify dataset ID (legacy, no login). |
--api-token KEY | Apify API token (required with --dataset). |
--toon-file PATH | Apify dataset exported as JSON/YAML. |
Files & Target
| Option | Description |
|---|---|
-u / --username HANDLE | Target Instagram handle (required for login/sessionid/setup). |
-o / --output DIR | Output directory (default: ./instagram_downloads). |
--flat | Flatten: single folder instead of YYYY-MM-DD/shortcode/. |
Filters (Apify mode only; login/sessionid modes download ALL posts)
| Option | Description |
|---|---|
--date-start YYYY-MM-DD | Earliest post date (inclusive). |
--date-end YYYY-MM-DD | Latest post date (inclusive). |
--type {reel,carousel,photo,all} | Filter by post type (default: all). |
--own-only | Only posts authored by --username. |
--mentions-only | Only posts from other accounts mentioning --username. |
Misc
| Option | Description |
|---|---|
--no-verify | Skip SSL verification (not recommended). |
--version | Show version and exit. |
--help | Show help message. |
Default Output Structure
instagram_downloads/
βββ YYYY-MM-DD/
βββ <SHORTCODE>/ # Reel
β βββ <SHORTCODE>.mp4
β βββ <SHORTCODE>.jpg # Thumbnail
β βββ post_info.txt
βββ <SHORTCODE>/ # Photo
β βββ <SHORTCODE>.jpg
β βββ post_info.txt
βββ <SHORTCODE>/ # Carousel
βββ <SHORTCODE>.jpg # First image (cl.photo_download)
βββ <SHORTCODE>_02.jpg # Image 2/N (from media_info)
βββ <SHORTCODE>_03.jpg # Image 3/N
βββ ...
βββ post_info.txt
Sessionid Under the Hood
Cookie Extraction
The --setup flow:
- Opens
https://www.instagram.comin the default browser viawebbrowser.open() - Polls the Chrome cookie SQLite database every 3 seconds
- Reads cookies using
sqlite3+ DPAPI key decryption (AES-GCM with no-authentication-tag) - Once
sessionidis detected, saves to~/.ig-downloader/config.json - Closes automatically
Media Fetching
user_id_from_username()β numeric user IDuser_medias(user_id, amount=0)β ALL media items (amount=0 means unlimited)- Each
Mediaobject has:pk,code(shortcode),media_type(1=photo, 2=video, 8=carousel),taken_at(datetime) - Carousels:
media_info(pk)returnscarousel_media[]with all resources - Downloads via
photo_download()/video_download()with proper auth
Config Storage
{
"sessionid": "YOUR_SESSIONID_COOKIE",
"created_at": "2026-07-07T22:00:00"
}
Location: ~/.ig-downloader/config.json
Examples
Sessionid mode (from config, simplest)
# After running --setup once
python instagram_downloader.py -u username -o ./downloads
Sessionid mode (direct flag)
python instagram_downloader.py \
-u username \
--sessionid "1234567890%3Aabcdef" \
-o ./downloads
Sessionid mode (environment variable)
set SESSIONID=1234567890%3Aabcdef
python instagram_downloader.py -u username -o ./downloads
Setup wizard (first time only)
python instagram_downloader.py --setup
Apify mode (toon file, with filters)
python instagram_downloader.py \
--toon-file ./data.txt \
-u username \
--type reel \
--date-start YYYY-MM-DD \
--date-end YYYY-MM-DD \
-o ./reels_only
Apify mode (API token)
python instagram_downloader.py \
--dataset <DATASET_ID> \
--api-token apify_api_xxx \
-u username \
-o ./downloads
Troubleshooting
| Problem | Solution |
|---|---|
| "No instagrapi" | pip install instagrapi |
| Login fails | Check username/password. For 2FA, provide --totp CODE. For challenge, check terminal for SMS/email prompt. |
| "Login required" in sessionid mode | sessionid expired. Re-run --setup to get a fresh one. |
| "No sessionid found" | Run --setup or pass --sessionid directly. |
| Chrome cookie extraction fails | Use --sessionid flag with manual cookie from DevTools. |
| 403 on fbcdn.net | Use login/sessionid mode (instagrapi handles auth). |
| Apify returns 403 | CDN URL expired β re-run the Actor. |
| GQL timeout | Old post > 4 weeks β falls back to Apify thumbnail. |
| No items in sessionid mode | Check username; profile may be private and sessionid may not follow it. |
| ModuleNotFoundError: No module named 'win32crypt' | Auto-detected; falls back to manual --sessionid flag. |
| "No items parsed" in toon mode | Toon format may differ β try --dataset API mode. |
Known Issues
1. Sessionid Expiration
Instagram session cookies expire after some time (days-weeks). When this happens, re-run --setup or pass a fresh --sessionid. Login mode avoids this via saved sessions + auto-reload.
2. Login Challenge Detection
Instagram may trigger a challenge (SMS/email code) on first login from a new IP. The script detects this and prompts you interactively. After the first successful login, the saved session prevents future challenges.
3. Chrome DPAPI Decryption
Cookie extraction uses Windows DPAPI + AES-GCM. Works with Chrome's latest cookie encryption (no-authentication-tag variant). If Chrome updates its format, extraction may break.
4. Private Profiles
Login/sessionid modes can only download profiles that the logged-in user follows. For private profiles you don't follow, Apify mode with unseenuser/IG-posts may work (the actor runs its own session).
5. Carousel GQL Limit (Apify mode)
GQL enhancement works only for recent posts (< 4 weeks). Older posts get single thumbnail. Login/sessionid modes avoid this entirely.
6. CDN URL Expiry (Apify mode)
Apify URLs expire after hours. Download soon after fetching. Login/sessionid modes avoid this entirely.
Changelog
| Version | Date | Changes |
|---|---|---|
| 2.4.0 | 2026-07 | GitHub topics for SkillsMP auto-discovery; ClawHub CLI install and auth; marketplace registration setup |
| 2.3.1 | 2026-07 | Installer documentation and AI agent integration guide; README updated with One-Click Install, Quick Start, Installation, AI Agent Integration sections |
| 2.3.0 | 2026-07 | Universal installers (install.sh + install.ps1) for AI agent skill distribution; auto-detect agent, pip install, skill file copy |
| 2.2.3 | 2026-07 | Replace USERNAME placeholders with cripterhack across project |
| 2.2.2 | 2026-07 | auto-release workflow; Mermaid diagrams in docs; enforce global-only opencode |
| 2.2.1 | 2026-07 | Fix deprecated setuptools backend; CI now uses setuptools.build_meta |
| 2.2.0 | 2026-07 | Playwright browser setup; triple fallback chain (Playwright β Chrome β manual paste) |
| 2.1.0 | 2026-07 | Login mode: --login with password prompt, 2FA (--totp), challenge handler, saved session persistence via dump_settings() |
| 2.0.0 | 2026-07 | Sessionid mode with instagrapi full access; interactive setup wizard; Chrome cookie extraction; config management; 3-mode architecture |
| 1.1.0 | 2026-07 | instagrapi GQL hybrid for carousel enhancement; --no-instagrapi flag |
| 1.0.0 | 2026-07 | Initial Apify-based release |
Instagram Downloader Skill v2.4.0 β Sessionid + Apify + Playwright setup. Zero compromises.
What ships with it: 13 files
147.8 KB alongside SKILL.md, 5 of them executable
scripts/
- auto_release.pyruns16.6 KB
tests/
- test_downloader.pyruns7.6 KB
- AGENTS.md8.9 KB
- CHANGELOG.md10.3 KB
- CONTRIBUTING.md5.0 KB
- .gitignore498 B
- instagram_downloader.pyruns41.1 KB
- install.ps1runs12.1 KB
- install.shruns11.4 KB
- LICENSE17.7 KB
- pyproject.toml796 B
- README.md15.7 KB
- requirements.txt54 B
Gives 1 of the 12 instructions most social media skills give in ~3.9k tokens
Counted across 489 of the 492 authors here whose files we hold, read 2026-08-07
- Adapt formats and tone to each platformin 26 of 489, across 14 files
- Build content around three to five pillarsin 25 of 489, across 13 files
- Read product marketing context before asking questionsin 23 of 489, across 13 files
- Respond to all comments on your postsin 21 of 489, across 9 files
- Use the output flag to specify an output directoryhere, and in 14 of 489, across 4 files
- Generate output logo images with white backgroundin 13 of 489, across 4 files
- Fix failing generation scripts directlyin 13 of 489, across 4 files
- Ask user about HTML preview after logo generationin 12 of 489, across 3 files
- Run the download script with a URLin 12 of 489, across 3 files
- Implement exponential backoff for 429 responsesin 12 of 489, across 3 files
- Write the hook firstin 12 of 489, across 7 files
- Include a single clear call to actionin 12 of 489, across 9 files
Said here and by no other author read
- Use sessionid or setup mode for authentication
- Do not use login mode
- Pass the sessionid cookie via flag, environment variable, or config
- Run setup wizard to acquire a sessionid
- Save extracted sessionid to config.json
- Specify target username with the -u flag
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.