Skip to main content

🌊 Nami

An open-source CLI media downloader for Instagram, TikTok, Facebook, and X

CI PyPI Version Python Version License: MIT

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.

InstallationQuickstartCLI CommandsPlatform MatrixConfigurationDevelopment


Features

  • Multi-Platform Batch Downloads: Extract high-resolution photos, videos, reels, posts, stories, and highlights.
  • Dual-Engine Architecture: Intelligently routes tasks between gallery-dl and yt-dlp with 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 --json output.
  • Smart Anti-Duplicate Archiving: Maintains per-target archive.txt records to avoid redundant re-downloads, with safe archive reset management.
  • 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 doctor to verify local binaries, browser installations, cookie permissions, and workspace health.

Supported Platforms

Platform Photos Videos / Reels Stories Highlights Auth Support Primary Engine
Instagram 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
Facebook 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:

  1. Netscape Cookie Files: Place cookie text files inside your configured cookies_dir:
    • instagram.com_cookies.txt (or instagram_cookies.txt)
    • facebook.com_cookies.txt (or facebook_cookies.txt)
    • x.com_cookies.txt (or x_cookies.txt, twitter.com_cookies.txt)
    • tiktok.com_cookies.txt (or tiktok_cookies.txt)
  2. Browser Extraction: Set browser (brave, chrome, edge, firefox) via nami config set browser <name> or NAMI_BROWSER environment 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

nami-4.0.0.tar.gz (66.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nami-4.0.0-py3-none-any.whl (53.5 kB view details)

Uploaded Python 3

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

Hashes for nami-4.0.0.tar.gz
Algorithm Hash digest
SHA256 66c8230be8c0eaa5d1d8a0e7888f1e06d96638f6691aa9ae33b573fb337d0daf
MD5 500aa76c0f6dfca71697a3acdf952b96
BLAKE2b-256 78f6f58c4f85555bc10f04bcb96616c4ef4031f916f8a01f40366f0cc2cf8f16

See more details on using hashes here.

Provenance

The following attestation bundles were made for nami-4.0.0.tar.gz:

Publisher: publish.yml on OpenSelena/nami

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for nami-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 953af1bb950f2f9b760d3f36bdefe34d4e4c3abf75bd3ac6f609509e586236c3
MD5 c2867e3f1826a5742767c9f7b2954d78
BLAKE2b-256 e6c01cd19681a800cf0c817a73ed0843abf22e469701e667149618ef7999c036

See more details on using hashes here.

Provenance

The following attestation bundles were made for nami-4.0.0-py3-none-any.whl:

Publisher: publish.yml on OpenSelena/nami

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

5.0.6

2 files

5.0.4

2 files

5.0.3

2 files

5.0.2

2 files

5.0.1

2 files

5.0.0

2 files

This release

4.0.0 This release

2 files

3.0.4

2 files

3.0.3

2 files

3.0.2

2 files

3.0.1

2 files

3.0.0

2 files

2.5.2

2 files

2.5.1

2 files

2.5.0

2 files

2.4.1

2 files

2.4.0

2 files

2.3.9

2 files

2.3.8

2 files

2.3.7

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page