🌊 Nami
An open-source CLI media downloader for Instagram, TikTok, Facebook, and X
Nami is a lightweight, open-source media archiver designed for seamless multi-platform media extraction. Combining Instaloader, gallery-dl, and yt-dlp with an interactive Rich terminal interface, Nami orchestrates three specialized extraction engines with deterministic fallback rules, deduplication, and secure authentication.
Installation • Usage Flow • Extractor Architecture • Supported Platforms • Directory Layout • Configuration
Features
- Multi-Engine Orchestration: Orchestrates
Instaloader,gallery-dl, andyt-dlpsimultaneously with deterministic capabilities. - Instagram Primary & Fallback Strategy: Uses Python-native
Instaloaderas the primary engine for Instagram profiles, posts, reels, stories, and highlights, withgallery-dlandyt-dlpas deterministic fallbacks. - Non-Instagram Engines: Uses
yt-dlp(primary video engine) andgallery-dl(fallback/gallery engine) for TikTok, Facebook, and X. - Failure-Aware Fallback: Fallbacks are triggered only for capability/extractor errors. Rate limits (
429) and network errors use backoff without stripping cookies or switching engines. - Smart Deduplication & Archive Safety: Historical download state in
archive.txtis preserved and never automatically deleted when media directories are emptied. - Authentication Security: Supports Netscape cookie files, browser cookie extraction, and Instaloader sessions. Credentials and cookies are strictly masked from logs.
- Terminal UI: Powered by
richwith customizable contrast themes (light/dark).
Extractor Architecture
┌─────────────────────┐
│ NAMI CLI │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Platform Router │
└──────────┬──────────┘
│
┌──────────────────────┼──────────────────────┐
▼ ▼ ▼
Instagram TikTok Facebook / X
│ │ │
▼ ▼ ▼
Extraction Plan Extraction Plan Extraction Plan
│ │ │
▼ ▼ ▼
Extractor Manager Extractor Manager Extractor Manager
│ │ │
┌────┼────┐ ┌────┴────┐ ┌──┴────┐
▼ ▼ ▼ ▼ ▼ ▼ ▼
Insta GD YTDLP YTDLP GD YTDLP GD
loader
│ │ │
└────┼────┘
▼
Failure Classifier
│
┌──────┼─────────┐
▼ ▼ ▼
Retry Fallback Stop
Engine Assignment
- Instagram:
Instaloader(Primary) $\rightarrow$gallery-dl/yt-dlp(Fallback) - TikTok:
yt-dlp(Primary) $\rightarrow$gallery-dl(Fallback) - Facebook:
yt-dlp(Primary) $\rightarrow$gallery-dl(Fallback) - X (Twitter):
yt-dlp(Primary) $\rightarrow$gallery-dl(Fallback)
Supported Platforms
| Platform | Photos | Videos | Stories | Highlights | Extractor Engines | Authentication Mode |
|---|---|---|---|---|---|---|
| Included | Included | Included | Included | Instaloader / gallery-dl / yt-dlp | Session File / Netscape Cookie / Anonymous | |
| TikTok | Included | Included | N/A | N/A | yt-dlp / gallery-dl | Browser DB / Netscape Cookie |
| Included | Included | N/A | N/A | yt-dlp / gallery-dl | Netscape Cookie / Anonymous | |
| X (Twitter) | Included | Included | N/A | N/A | yt-dlp / gallery-dl | Netscape Cookie / Anonymous |
Installation
Install nami directly via pip:
pip install nami
All extraction engines (instaloader, gallery-dl, yt-dlp) and rich are automatically installed.
To upgrade to the latest release:
pip install -U nami
Usage Flow
1. Project Workspace Initializer
When you launch nami for the first time, it automatically creates your local workspace structure:
Nami/
├── downloads/ # Extracted media organized by platform & account
├── cookies/ # Netscape cookie files (*_cookies.txt) & Instaloader session files (session-*)
└── profiles/ # Target account URL text files (*_profiles.txt)
2. Configure Profile Sources
Add your target account URLs into the designated text files inside Nami/profiles/:
Nami/profiles/
├── instagram_profiles.txt # Add Instagram profile URLs (one per line)
├── tiktok_profiles.txt # Add TikTok profile URLs
├── facebook_profiles.txt # Add Facebook profile URLs
└── x_profiles.txt # Add X / Twitter profile URLs
3. Session Authentication
Place Netscape-formatted cookie files or Instaloader session files inside Nami/cookies/:
session-<username>(Instaloader session file)instagram.com_cookies.txt(Netscape cookie file)facebook.com_cookies.txtx.com_cookies.txt
4. Interactive Execution & Filtering
Launch the application to run batch downloads across your configured profile lists:
nami
Troubleshooting
- HTTP 429 Rate Limit: Nami automatically enters backoff retry without stripping cookies or switching engines. If rate limited, wait a few minutes before retrying.
- urllib3 namespace conflicts: Run
python -m pip install -U nami gallery-dl yt-dlp instaloader urllib3to align dependencies. - Missing Session / Cookie File: Ensure cookie files are placed in
<workspace>/Nami/cookies/and match the expected naming format (<platform>.com_cookies.txtorsession-<username>).
Privacy & Security
- No Passwords Stored: Passwords are never logged or stored in
nami_config.json. - Log Masking: Sensitive session tokens, raw cookies, and authentication headers are masked from debug logs.
- File Permissions: Secure permissions (
0600for files,0700for directories) are applied on Unix systems.
License
Distributed under the MIT License. Developed and maintained by Igect under OpenSelena.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nami-2.5.1.tar.gz.
File metadata
- Download URL: nami-2.5.1.tar.gz
- Upload date:
- Size: 31.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41d7e7945fd0fcfc86520ad10ff2831eceed0976cc9f21755b2bfba5c8199b26
|
|
| MD5 |
1c9b741a2cac573a82f2ffdf76e3af9e
|
|
| BLAKE2b-256 |
6e5c947fbd633e68e2a536e7cb7c372462b2de755857cf65e3a8b2bd23c969a0
|
Provenance
The following attestation bundles were made for nami-2.5.1.tar.gz:
Publisher:
publish.yml on OpenSelena/nami
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nami-2.5.1.tar.gz -
Subject digest:
41d7e7945fd0fcfc86520ad10ff2831eceed0976cc9f21755b2bfba5c8199b26 - Sigstore transparency entry: 2447499379
- Sigstore integration time:
-
Permalink:
OpenSelena/nami@c49e44c07187064852d4a23aec707582912f0d17 -
Branch / Tag:
refs/tags/v2.5.1 - Owner: https://github.com/OpenSelena
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c49e44c07187064852d4a23aec707582912f0d17 -
Trigger Event:
release
-
Statement type:
File details
Details for the file nami-2.5.1-py3-none-any.whl.
File metadata
- Download URL: nami-2.5.1-py3-none-any.whl
- Upload date:
- Size: 32.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ccfc27566f8e4983803ff050f8c1219fc835489f709e1d56399ce998d64208f
|
|
| MD5 |
e75640a5f584d67055e205d5921b55a8
|
|
| BLAKE2b-256 |
6afe1b45e45c2361e4c12e3ab750d6c7a80fd5dc76f1a9f3093852f7279628f2
|
Provenance
The following attestation bundles were made for nami-2.5.1-py3-none-any.whl:
Publisher:
publish.yml on OpenSelena/nami
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nami-2.5.1-py3-none-any.whl -
Subject digest:
3ccfc27566f8e4983803ff050f8c1219fc835489f709e1d56399ce998d64208f - Sigstore transparency entry: 2447499393
- Sigstore integration time:
-
Permalink:
OpenSelena/nami@c49e44c07187064852d4a23aec707582912f0d17 -
Branch / Tag:
refs/tags/v2.5.1 - Owner: https://github.com/OpenSelena
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c49e44c07187064852d4a23aec707582912f0d17 -
Trigger Event:
release
-
Statement type: