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 gallery-dl (primary gallery/archiving engine) and yt-dlp (video/specialized engine) with an interactive Rich terminal interface, Nami orchestrates two powerful extraction engines with deterministic fallback rules, deduplication, and secure authentication.

InstallationUsage FlowExtractor ArchitectureSupported PlatformsDirectory LayoutConfiguration


Features

  • 2-Engine Architecture: Powered by gallery-dl and yt-dlp with deterministic capability mapping.
  • Instagram Gallery-DL Archiving: Uses gallery-dl as the primary extraction engine for Instagram profiles, photos, videos, reels, stories, and highlights.
  • Video & Fallback Engine: Uses yt-dlp as the primary video engine for TikTok, Facebook, and X, and controlled fallback for Instagram videos/reels.
  • Failure-Aware Fallback Policy: Automatic engine fallback is allowed only for EXTRACTOR and UNSUPPORTED errors. Rate limits (429), authentication errors, and network failures halt safely without hammering platforms.
  • 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 (<platform>.com_cookies.txt) and browser cookies. Credentials are strictly masked from logs.
  • Terminal UI: Powered by rich with explicit status indicators (✓ downloaded, ⚠ Rate limited, ✗ Failed, N/A Unsupported).

Extractor Architecture

                         ┌─────────────────────┐
                         │       NAMI CLI      │
                         └──────────┬──────────┘
                                    │
                                    ▼
                         ┌─────────────────────┐
                         │   Platform Router   │
                         └──────────┬──────────┘
                                    │
             ┌──────────────────────┼──────────────────────┐
             ▼                      ▼                      ▼
       Instagram                  TikTok               Facebook / X
             │                      │                      │
             ▼                      ▼                      ▼
       Extraction Plan        Extraction Plan        Extraction Plan
             │                      │                      │
             ▼                      ▼                      ▼
       Extractor Manager       Extractor Manager      Extractor Manager
             │                      │                      │
         ┌───┴───┐              ┌───┴───┐              ┌───┴───┐
         ▼       ▼              ▼       ▼              ▼       ▼
        GD     YTDLP          YTDLP    GD            YTDLP    GD
         │       │
         └───┬───┘
             ▼
      Failure Classifier
             │
      ┌──────┼─────────┐
      ▼      ▼         ▼
    Retry  Fallback   Stop

Engine Assignment

  • Instagram: gallery-dl (Primary) $\rightarrow$ yt-dlp (Controlled Video 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 gallery-dl / yt-dlp 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 (gallery-dl, yt-dlp) and rich are automatically installed.

To upgrade to the latest release:

pip install -U --no-cache-dir 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)
└── 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 inside Nami/cookies/:

  • 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 halts cleanly without hammering platforms with multiple extractors. Wait a few minutes before retrying.
  • urllib3 namespace conflicts: Run python -m pip install -U nami gallery-dl yt-dlp urllib3 to align dependencies.
  • Missing Cookie File: Ensure Netscape cookie files are placed in <workspace>/Nami/cookies/ and match the expected naming format (<platform>.com_cookies.txt).

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-3.0.0.tar.gz (30.6 kB view details)

Uploaded Source

Built Distribution

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

nami-3.0.0-py3-none-any.whl (30.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for nami-3.0.0.tar.gz
Algorithm Hash digest
SHA256 e392b4b8a010db239a68d966db18a5a54421778dbd794b3497f01110ed2befda
MD5 519d8c1b423e46cc2481b7546cd50d9e
BLAKE2b-256 903801e1e3935b5d197ea0993f2cfe78bfcc954bc7dd95e5e90183b65617fed5

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for nami-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8670d58765b466da9c1edc06f36e480dc26a67dbfa43c7e20dbdf506cee9c48f
MD5 cf7cbd316568bfee04d5d3bc48eff383
BLAKE2b-256 889ef6f9c62e87c2452e479a6d47498c50af422602552aba9fa677ec785150b9

See more details on using hashes here.

Provenance

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

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

This release

3.0.0 This release

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