agentsclimarketplace

Ig downloader skill

Skill CripterHack/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

Install
npx -y skills add CripterHack/ig-downloader-skill

Assembled 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: --login mode is BROKEN. Meta deprecated the instagrapi login endpoint server-side. The --login, --password, and --totp flags exist but return 404. Use --setup (Playwright) or a manual --sessionid cookie 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

AspectSessionid πŸ₯‡Apify (legacy)Setup Wizard
AuthenticationCookie sessionidNonePlaywright browser
All posts (any date)βœ… Yesβœ… YesN/A (setup only)
Carousels: ALL imagesβœ… Yes❌ 1st image only (old posts)N/A
Carousels: recent onlyβœ… Yesβœ… GQL enhancementN/A
Private profilesβœ… (if you follow)❌N/A
No watermark reelsβœ… Yesβœ… Yes (Apify)N/A
Session persistenceβœ… config.jsonN/Aβœ… config.json
Setup time1 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:

  1. --sessionid CLI flag β€” one-shot session cookie (highest priority)
  2. SESSIONID environment variable β€” for CI/automation
  3. Config file (~/.ig-downloader/config.json) β€” persistent, set by --setup
  4. 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 --login mode (and its settings.json persistence) 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 instagrapi
  • requests: 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)

  1. Open Chrome, go to https://www.instagram.com
  2. Log in to Instagram
  3. Press F12 β†’ Application β†’ Cookies β†’ www.instagram.com
  4. Find sessionid β€” copy its value
  5. 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)

OptionDescription
--sessionid STRInstagram sessionid cookie (one-shot, overrides config/env). Recommended auth method.
--setupInteractive 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.
--setupInteractive setup: opens browser, polls for login, saves sessionid to config.
--dataset IDApify dataset ID (legacy, no login).
--api-token KEYApify API token (required with --dataset).
--toon-file PATHApify dataset exported as JSON/YAML.

Files & Target

OptionDescription
-u / --username HANDLETarget Instagram handle (required for login/sessionid/setup).
-o / --output DIROutput directory (default: ./instagram_downloads).
--flatFlatten: single folder instead of YYYY-MM-DD/shortcode/.

Filters (Apify mode only; login/sessionid modes download ALL posts)

OptionDescription
--date-start YYYY-MM-DDEarliest post date (inclusive).
--date-end YYYY-MM-DDLatest post date (inclusive).
--type {reel,carousel,photo,all}Filter by post type (default: all).
--own-onlyOnly posts authored by --username.
--mentions-onlyOnly posts from other accounts mentioning --username.

Misc

OptionDescription
--no-verifySkip SSL verification (not recommended).
--versionShow version and exit.
--helpShow 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:

  1. Opens https://www.instagram.com in the default browser via webbrowser.open()
  2. Polls the Chrome cookie SQLite database every 3 seconds
  3. Reads cookies using sqlite3 + DPAPI key decryption (AES-GCM with no-authentication-tag)
  4. Once sessionid is detected, saves to ~/.ig-downloader/config.json
  5. Closes automatically

Media Fetching

  • user_id_from_username() β†’ numeric user ID
  • user_medias(user_id, amount=0) β†’ ALL media items (amount=0 means unlimited)
  • Each Media object has: pk, code (shortcode), media_type (1=photo, 2=video, 8=carousel), taken_at (datetime)
  • Carousels: media_info(pk) returns carousel_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

ProblemSolution
"No instagrapi"pip install instagrapi
Login failsCheck username/password. For 2FA, provide --totp CODE. For challenge, check terminal for SMS/email prompt.
"Login required" in sessionid modesessionid expired. Re-run --setup to get a fresh one.
"No sessionid found"Run --setup or pass --sessionid directly.
Chrome cookie extraction failsUse --sessionid flag with manual cookie from DevTools.
403 on fbcdn.netUse login/sessionid mode (instagrapi handles auth).
Apify returns 403CDN URL expired β†’ re-run the Actor.
GQL timeoutOld post > 4 weeks β†’ falls back to Apify thumbnail.
No items in sessionid modeCheck 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 modeToon 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

VersionDateChanges
2.4.02026-07GitHub topics for SkillsMP auto-discovery; ClawHub CLI install and auth; marketplace registration setup
2.3.12026-07Installer documentation and AI agent integration guide; README updated with One-Click Install, Quick Start, Installation, AI Agent Integration sections
2.3.02026-07Universal installers (install.sh + install.ps1) for AI agent skill distribution; auto-detect agent, pip install, skill file copy
2.2.32026-07Replace USERNAME placeholders with cripterhack across project
2.2.22026-07auto-release workflow; Mermaid diagrams in docs; enforce global-only opencode
2.2.12026-07Fix deprecated setuptools backend; CI now uses setuptools.build_meta
2.2.02026-07Playwright browser setup; triple fallback chain (Playwright β†’ Chrome β†’ manual paste)
2.1.02026-07Login mode: --login with password prompt, 2FA (--totp), challenge handler, saved session persistence via dump_settings()
2.0.02026-07Sessionid mode with instagrapi full access; interactive setup wizard; Chrome cookie extraction; config management; 3-mode architecture
1.1.02026-07instagrapi GQL hybrid for carousel enhancement; --no-instagrapi flag
1.0.02026-07Initial 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/

tests/

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.

Keep looking

Skills are one crate of 326,452. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.