Skip to main content

🌊 Nami

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

PyPI Version Python Version License GitHub Stars

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.

InstallationUsage FlowExtractor ArchitectureSupported PlatformsDirectory LayoutConfiguration


Features

  • Multi-Engine Orchestration: Orchestrates Instaloader, gallery-dl, and yt-dlp simultaneously with deterministic capabilities.
  • Instagram Primary & Fallback Strategy: Uses Python-native Instaloader as the primary engine for Instagram profiles, posts, reels, stories, and highlights, with gallery-dl and yt-dlp as deterministic fallbacks.
  • Non-Instagram Engines: Uses yt-dlp (primary video engine) and gallery-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.txt is 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 rich with 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
Instagram 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
Facebook 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.txt
  • x.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 urllib3 to align dependencies.
  • Missing Session / Cookie File: Ensure cookie files are placed in <workspace>/Nami/cookies/ and match the expected naming format (<platform>.com_cookies.txt or session-<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 (0600 for files, 0700 for 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

nami-2.5.2.tar.gz (32.2 kB view details)

Uploaded Source

Built Distribution

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

nami-2.5.2-py3-none-any.whl (33.2 kB view details)

Uploaded Python 3

File details

Details for the file nami-2.5.2.tar.gz.

File metadata

  • Download URL: nami-2.5.2.tar.gz
  • Upload date:
  • Size: 32.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nami-2.5.2.tar.gz
Algorithm Hash digest
SHA256 14ded2fa1760a8dc42e248f5f1e0365534af58cf616ae86b68dbab4b07e0bdc1
MD5 5ff07f8e563d3f50c696babdfd64b22f
BLAKE2b-256 33c78bf99d9751b19ab9135282c3a6196b3d1c7a116923c84b1a8e29243a8648

See more details on using hashes here.

Provenance

The following attestation bundles were made for nami-2.5.2.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-2.5.2-py3-none-any.whl.

File metadata

  • Download URL: nami-2.5.2-py3-none-any.whl
  • Upload date:
  • Size: 33.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nami-2.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5fa6d7464e2e6140a80ea3ec6a5500f14fec7d1a5e3d45290bad5e0747e33398
MD5 95cb99fd795d50a3aa5d590f3d7ad93b
BLAKE2b-256 befc139983b6d30a3a9c2c0cf707d0c3abbf223c5d65d80901816f9163366bad

See more details on using hashes here.

Provenance

The following attestation bundles were made for nami-2.5.2-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

4.0.0

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

This release

2.5.2 This release

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