igdl
by bobobowis
README.md
<p align="center">
<img src="assets/wordmark.svg" alt="igdl" width="360">
</p>
<p align="center">
<b>Download Instagram posts, reels and carousels (photos <i>and</i> videos) from your terminal, your code, or your AI assistant.</b>
</p>
<p align="center">
<img alt="Node 20+" src="https://img.shields.io/badge/node-%E2%89%A520-3c873a?logo=node.js&logoColor=white">
<img alt="MCP server" src="https://img.shields.io/badge/MCP-server-7B3FF2">
<img alt="Claude Code plugin" src="https://img.shields.io/badge/Claude%20Code-plugin-E8317F">
<img alt="powered by yt-dlp" src="https://img.shields.io/badge/powered%20by-yt--dlp-FF5A4E">
<img alt="MIT" src="https://img.shields.io/badge/license-MIT-FFB547">
</p>
---
```console
$ igdl https://www.instagram.com/p/DgIxT9JG6no/
✓ https://www.instagram.com/p/DgIxT9JG6no/ @instagram 8 file(s)
downloads/instagram_DgIxT9JG6no_1.jpg
downloads/instagram_DgIxT9JG6no_2.mp4
downloads/instagram_DgIxT9JG6no_3.jpg
…
```
## Features
- **Everything in the post:** single photos, reels, videos and mixed carousels, in carousel order.
- **Best quality:** full-size original photos, and the best video merged with its audio.
- **Four ways to use it:** a CLI, a Node library, an MCP server, and a Claude Code plugin with a ready-made skill.
- **Metadata:** author, caption, date, likes, comments, and direct media links.
- **Low maintenance:** Instagram access goes through [yt-dlp](https://github.com/yt-dlp/yt-dlp). When Instagram changes something, run `yt-dlp -U`.
- **Your login, if you want it:** read cookies from your own browser for private posts you can see.
## Quick start
```sh
pipx install yt-dlp # or: pip install -U yt-dlp
git clone https://github.com/bobobowis/igdl && cd igdl
npm install && npm link # puts `igdl` on your PATH
igdl https://www.instagram.com/reel/DgLBIFYxY4O/
```
## CLI
```text
igdl <url...> [-d <dir>] download posts/reels/carousels (default dir: ./downloads)
igdl info <url...> print metadata + direct media links as JSON
igdl mcp run the MCP server on stdio
-d, --dir <dir> download directory
-c, --cookies <browser> use your Instagram login from firefox | chrome | edge | brave | …
```
Files are named `<username>_<shortcode>[_<n>].<ext>`.
## Library
```js
import { createClient } from 'igdl';
const ig = createClient(); // or createClient({ cookiesFromBrowser: 'firefox' })
const post = await ig.resolve('https://www.instagram.com/p/DgIxT9JG6no/');
post.meta; // { username, shortcode, caption, takenAt, likes, comments }
post.items; // [{ index, type: 'image' | 'video', ext, width, height, url, headers, thumbnail }]
const { files } = await ig.download(url, { dir: './downloads' });
```
Direct `url`s point at Instagram's CDN and expire after a few hours. Send the given `headers` with them.
## MCP server
igdl provides two tools to any MCP client:
| Tool | What it does |
|---|---|
| `instagram_info(url)` | Returns metadata and direct photo/video links |
| `instagram_download(url, dir?)` | Saves every item and returns the file paths (default `~/Downloads/instagram`) |
**Claude Code:**
```sh
claude mcp add igdl -- node /path/to/igdl/src/launch.js
```
**Claude Desktop, Cursor and others:**
```json
{
"mcpServers": {
"igdl": { "command": "node", "args": ["/path/to/igdl/src/launch.js"] }
}
}
```
`launch.js` installs the npm dependencies on first run and warns you if yt-dlp is missing.
## Claude Code plugin
Installs the MCP server plus an `instagram-download` skill, so Claude knows when and how to use it:
```text
/plugin marketplace add bobobowis/igdl
/plugin install igdl@igdl
```
Then paste a link and ask *"save this"*.
## How it works
```mermaid
flowchart LR
URL[Instagram URL] --> Y["yt-dlp -J<br/>(one request to Instagram)"]
Y --> M[post metadata]
M -->|videos| V["yt-dlp --load-info-json<br/>best video + audio"]
M -->|photos| P["fetch full-size image<br/>(yt-dlp skips photos)"]
V --> F[(files)]
P --> F
```
yt-dlp handles Instagram access and its changes. igdl adds photo support, carousel ordering, consistent
file names, and the library, MCP and skill layers on top.
## Configuration
| Variable | Default | Purpose |
|---|---|---|
| `IGDL_COOKIES_FROM_BROWSER` | none | Browser to read your Instagram login from |
| `IGDL_DIR` | `~/Downloads/instagram` | Default download dir for the MCP server |
| `YTDLP_BIN` | `yt-dlp` | Path to the yt-dlp binary |
## Troubleshooting
| Message | Fix |
|---|---|
| `yt-dlp is not installed` | `pipx install yt-dlp` |
| `post not found, private, or Instagram wants a login` | The post is private or deleted, or logged-out access is being throttled. Try `-c firefox`. |
| `rate limited by Instagram` | Wait a few minutes. Logged-out access is limited per IP. |
| It worked yesterday | `yt-dlp -U` |
## Disclaimer
For personal use. Download only content you have the right to save, respect creators, and follow
Instagram's Terms of Use. Not affiliated with Instagram or Meta.
## License
[MIT](LICENSE)
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues