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.1.tar.gz (31.8 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.1-py3-none-any.whl (32.8 kB view details)

Uploaded Python 3

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

Hashes for nami-2.5.1.tar.gz
Algorithm Hash digest
SHA256 41d7e7945fd0fcfc86520ad10ff2831eceed0976cc9f21755b2bfba5c8199b26
MD5 1c9b741a2cac573a82f2ffdf76e3af9e
BLAKE2b-256 6e5c947fbd633e68e2a536e7cb7c372462b2de755857cf65e3a8b2bd23c969a0

See more details on using hashes here.

Provenance

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

Hashes for nami-2.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3ccfc27566f8e4983803ff050f8c1219fc835489f709e1d56399ce998d64208f
MD5 e75640a5f584d67055e205d5921b55a8
BLAKE2b-256 6afe1b45e45c2361e4c12e3ab750d6c7a80fd5dc76f1a9f3093852f7279628f2

See more details on using hashes here.

Provenance

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

This release

2.5.1 This release

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