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.0.tar.gz (30.5 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.0-py3-none-any.whl (32.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nami-2.5.0.tar.gz
  • Upload date:
  • Size: 30.5 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.0.tar.gz
Algorithm Hash digest
SHA256 70ff768fd7fc43264062260a82479b68fdc1d72c0dc878a5e3ae96e0075c4f41
MD5 34c2865fb729a2c80bcc6c055858cf23
BLAKE2b-256 80570a3a1809d21fca52fbae65545788dec7a59c5500b17f543b48fb77d1babb

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: nami-2.5.0-py3-none-any.whl
  • Upload date:
  • Size: 32.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0243c32054661c833ccb24f6a50223c89e59ad46f4e0d5c2c7f80b5fc51b0dff
MD5 397d8ba9cb452efb5aca6a591e271c23
BLAKE2b-256 985971aedf63a30b9399823fc493c49292299b844037d791be3bd9efab695d22

See more details on using hashes here.

Provenance

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

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

2.5.2

2 files

2.5.1

2 files

This release

2.5.0 This release

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