🌊 Nami
An open-source CLI media downloader for Instagram, TikTok, Facebook, and X
Nami is a high-performance, modular CLI and interactive media downloader for Instagram, TikTok, Facebook, and X (Twitter). Powered by gallery-dl and yt-dlp engines with a modern Rich terminal UI, Nami provides dual-engine fallback, anti-duplicate archiving, automated cookie management, health doctor diagnostics, and machine-readable JSON workflows.
Installation • Quickstart • CLI Commands • Platform Matrix • Configuration • Development
Features
- Multi-Platform Batch Downloads: Extract high-resolution photos, videos, reels, posts, stories, and highlights.
- Dual-Engine Architecture: Intelligently routes tasks between
gallery-dlandyt-dlpwith automatic fallback on extractor failures. - Interactive & Headless Modes: Run interactively with an intuitive terminal UI or integrate into headless pipelines with dedicated CLI subcommands and
--jsonoutput. - Smart Anti-Duplicate Archiving: Maintains per-target
archive.txtrecords to avoid redundant re-downloads, with safearchive resetmanagement. - Flexible Authentication: Supports Netscape cookie files, anonymous fallbacks, and direct browser cookie extraction (
--cookies-from-browser). - Resilient Retry Policy: Exponential jittered backoff for transient network errors, immediate rate-limit handling, and process isolation.
- Built-in Doctor: Run
nami doctorto verify local binaries, browser installations, cookie permissions, and workspace health.
Supported Platforms
| Platform | Photos | Videos / Reels | Stories | Highlights | Auth Support | Primary Engine |
|---|---|---|---|---|---|---|
| Included | Included | Included | Included | Netscape Cookie / Anonymous | gallery-dl / yt-dlp |
|
| TikTok | Included | Included | N/A | N/A | Browser DB / Netscape Cookie | yt-dlp / gallery-dl |
| Included | Included | N/A | N/A | Netscape Cookie / Anonymous | gallery-dl / yt-dlp |
|
| X (Twitter) | Included | Included | N/A | N/A | Netscape Cookie / Anonymous | gallery-dl / yt-dlp |
Installation
Install nami via pip:
pip install nami
Dependencies (rich, gallery-dl, yt-dlp) are automatically installed.
To upgrade to the latest version:
pip install -U nami
Quickstart
1. Interactive Mode
Run nami without arguments to launch the interactive terminal UI:
nami
┌──────────────────────── Nami ────────────────────────┐
│ What do you want to download? │
│ │
│ 1 Photos only │
│ 2 Videos only │
│ 3 Stories only │
│ 4 Highlights only │
│ 5 Photos + Videos │
│ 6 Stories + Highlights │
│ 7 All │
│ 8 Settings │
│ 0 Exit │
└──────────────────────────────────────────────────────┘
On first launch, Nami guides you through workspace initialization.
2. Workspace Layout
Nami organizes downloads, cookie files, and target profile lists cleanly:
Nami/
├── downloads/ # Extracted media organized by platform, account & kind
├── cookies/ # Optional Netscape cookie files (*_cookies.txt)
└── profiles/ # Target profile URLs (*_profiles.txt)
CLI Commands Reference
Nami provides a full suite of scriptable subcommands for headless and automated pipelines:
nami setup
Initialize a Nami workspace directory structure and configuration:
# Initialize workspace under current directory
nami setup --root .
# Initialize with template cookie files
nami setup --root /path/to/workspace --cookie-templates
# Output JSON report
nami setup --root . --json
nami download
Download specific target URLs or batch profiles:
# Download direct URLs
nami download https://www.instagram.com/p/DAEXAMPLE123/ https://x.com/OpenAI/status/123456
# Batch download all configured profile files
nami download --profiles
# Filter by platform and specific media kinds
nami download --profiles --platform instagram --media stories,highlights
nami download https://www.tiktok.com/@creator --media videos
# Machine-readable JSON output
nami download --profiles --json
Media kinds options: photos, videos, stories, highlights, all (or comma-separated list).
nami doctor
Inspect system health, engine availability, browser installations, and workspace configuration:
nami doctor
nami doctor --json
nami config
Inspect and update persistent configuration settings:
# Show all active settings
nami config show
# Get a specific setting value
nami config get browser
nami config get base_dir
# Set a setting value
nami config set browser chrome
nami config set timeout_seconds 600
# Reset a setting to its default/derived value
nami config unset browser
Configurable keys: base_dir, cookies_dir, profiles_dir, browser, user_agent, timeout_seconds.
nami archive reset
Safely manage download tracking archives to enable re-downloading media:
# Preview archives that would be reset
nami archive reset --platform instagram --dry-run
# Back up archives for a specific profile (creates timestamped .bak)
nami archive reset --platform instagram --target nasa --yes
# Reset all archives permanently
nami archive reset --all --delete --yes
Authentication & Cookies
To access private content, high-resolution stories, or avoid login walls:
- Netscape Cookie Files: Place cookie text files inside your configured
cookies_dir:instagram.com_cookies.txt(orinstagram_cookies.txt)facebook.com_cookies.txt(orfacebook_cookies.txt)x.com_cookies.txt(orx_cookies.txt,twitter.com_cookies.txt)tiktok.com_cookies.txt(ortiktok_cookies.txt)
- Browser Extraction: Set
browser(brave,chrome,edge,firefox) vianami config set browser <name>orNAMI_BROWSERenvironment variable.
Configuration & Environment Variables
Settings are saved in ~/.nami/nami_config.json. You can override defaults using environment variables:
| Variable | Description | Default |
|---|---|---|
NAMI_BASE_DIR |
Custom output downloads directory path | ~/Nami/downloads |
NAMI_COOKIES_DIR |
Custom Netscape cookie directory path | ~/Nami/cookies |
NAMI_PROFILES_DIR |
Custom profile text files directory path | ~/Nami/profiles |
NAMI_BROWSER |
Browser for automated cookie extraction (brave, chrome, edge, firefox) |
brave |
NAMI_USER_AGENT |
Custom HTTP User-Agent string | Standard Chrome string |
NAMI_TIMEOUT_SECONDS |
Child engine process execution timeout in seconds | 900 |
NAMI_THEME |
Terminal UI theme (dark or light) |
dark |
NAMI_SKIP_ENV_CHECK |
Set to 1 to bypass startup binary presence check |
0 |
Development & Testing
Clone the repository and install dev dependencies:
git clone https://github.com/OpenSelena/nami.git
cd nami
pip install -e ".[dev]"
Run test suite and quality checks:
# Run pytest
pytest
# Run Ruff linter and formatter checks
ruff check src tests
ruff format --check src tests
# Build and verify distribution package
python -m build
twine check dist/*
check-wheel-contents dist/*.whl
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-4.0.0.tar.gz.
File metadata
- Download URL: nami-4.0.0.tar.gz
- Upload date:
- Size: 66.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66c8230be8c0eaa5d1d8a0e7888f1e06d96638f6691aa9ae33b573fb337d0daf
|
|
| MD5 |
500aa76c0f6dfca71697a3acdf952b96
|
|
| BLAKE2b-256 |
78f6f58c4f85555bc10f04bcb96616c4ef4031f916f8a01f40366f0cc2cf8f16
|
Provenance
The following attestation bundles were made for nami-4.0.0.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-4.0.0.tar.gz -
Subject digest:
66c8230be8c0eaa5d1d8a0e7888f1e06d96638f6691aa9ae33b573fb337d0daf - Sigstore transparency entry: 2490566970
- Sigstore integration time:
-
Permalink:
OpenSelena/nami@17c86dc7e79fb461351942f1c330a256e6a80489 -
Branch / Tag:
refs/tags/v4.0.0 - Owner: https://github.com/OpenSelena
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@17c86dc7e79fb461351942f1c330a256e6a80489 -
Trigger Event:
release
-
Statement type:
File details
Details for the file nami-4.0.0-py3-none-any.whl.
File metadata
- Download URL: nami-4.0.0-py3-none-any.whl
- Upload date:
- Size: 53.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
953af1bb950f2f9b760d3f36bdefe34d4e4c3abf75bd3ac6f609509e586236c3
|
|
| MD5 |
c2867e3f1826a5742767c9f7b2954d78
|
|
| BLAKE2b-256 |
e6c01cd19681a800cf0c817a73ed0843abf22e469701e667149618ef7999c036
|
Provenance
The following attestation bundles were made for nami-4.0.0-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-4.0.0-py3-none-any.whl -
Subject digest:
953af1bb950f2f9b760d3f36bdefe34d4e4c3abf75bd3ac6f609509e586236c3 - Sigstore transparency entry: 2490567220
- Sigstore integration time:
-
Permalink:
OpenSelena/nami@17c86dc7e79fb461351942f1c330a256e6a80489 -
Branch / Tag:
refs/tags/v4.0.0 - Owner: https://github.com/OpenSelena
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@17c86dc7e79fb461351942f1c330a256e6a80489 -
Trigger Event:
release
-
Statement type: