Skip to main content

Nudebomb

Nudebomb recursively strips MKV (Matroska) files of unwanted audio and subtitle tracks, keeping only the languages you specify.

Installation

Requirements

  • MKVToolNix — provides the mkvmerge binary. Available via Homebrew, apt, or your favorite package manager.

Install

pip install nudebomb

Or with uv:

uv tool install nudebomb

Quick Start

Strip all non-English tracks from a directory tree:

nudebomb -rl eng /mnt/movies

Keep English and French, recurse, and use timestamps to skip already-processed files:

nudebomb -rtl eng,fra /mnt/movies

Dry run on a single file to preview what would be stripped:

nudebomb -dvvl eng movie.mkv
Stripping languages except eng, und.
Searching for MKV files to process:
Checking movie.mkv
    audio: 1 eng
    audio: 2 eng
    audio: 3 eng
    subtitles: 4 eng
    subtitles: 5 eng
    Already stripped movie.mkv
done.

Usage

nudebomb [options] path [path ...]

Paths can be individual MKV files or directories. Use -r to recurse into directories.

Configuration

Nudebomb is configured through four layers, each overriding the previous:

  1. User config file — ~/.config/nudebomb/config.yaml
  2. Directory config files — .nudebomb.yaml in a target directory (see Directory Config Files)
  3. Environment variables
  4. Command-line arguments

Config File

nudebomb:
    languages:
        - eng
        - und
    recurse: true
    timestamps: true
    media_type: movie
    tmdb_api_key: your-api-key-here
    tvdb_api_key: your-api-key-here

All command-line options have config file equivalents.

Use -c INPUT to supply an input config file. It replaces your default user config for that run (the packaged defaults still apply beneath it).

Nudebomb can also write your invoked options back out as config, then run normally:

  • -w/--write-config writes them to your user config file, located automatically — no path needed. -c base.yaml -w derives your user config from base.yaml plus the options you gave.
  • -W/--write-dir-config writes or updates a .nudebomb.yaml in each target directory (see Directory Config Files).
  • --write-config-file PATH writes to a specific file (advanced), merging -c INPUT (or the existing PATH) with your options.

Existing keys and comments are preserved. Run-mode flags (--dry-run and verbosity) are not persisted, and files are written owner-readable only since they may hold API keys. -W persists whatever you invoked, so omit API keys you don't want stored in a media tree.

Environment Variables

Prefix with NUDEBOMB_NUDEBOMB__. List items are enumerated:

export NUDEBOMB_NUDEBOMB__RECURSE=True
export NUDEBOMB_NUDEBOMB__LANGUAGES__0=eng
export NUDEBOMB_NUDEBOMB__LANGUAGES__1=fra
export NUDEBOMB_NUDEBOMB__TMDB_API_KEY=your-api-key-here

Directory Config Files

Drop a .nudebomb.yaml in any target directory to override settings for that directory and everything beneath it. Write one by hand, or run with -W/--write-dir-config to save your invoked options into each target directory. It uses the same nudebomb: format as the user config:

# /mnt/anime/.nudebomb.yaml
nudebomb:
    sub_languages:
        - jpn
    title: false
    media_type: tv

Discovery. For each MKV, nudebomb walks up the tree from the file's directory to the path you named on the command line (never above it, exactly like lang files), collecting every .nudebomb.yaml it finds. A config outside the paths you pass never affects a run.

Layering. Directory configs sit above your user config but below environment variables and command-line options, so -c/CLI/env always win. A deeper directory's config overrides a shallower one. A .nudebomb.yaml may set any config key. Keys that select which tracks to keep (languages, sub_languages, subtitles, strip_und_language, und_language, title, mkvmerge_bin), the lookup media_type, the traversal knobs (ignore, recurse, symlinks), and timestamps take effect per directory — so, for example, a Movies/ folder can set media_type: movie and enable timestamps for itself. Run-scope keys — API keys, lookup_workers, cache_expiry_days, after, --dry-run, and verbosity — are read once for the whole run, so setting them in a directory config has no per-directory effect.

Unlike lang files, a directory config's languages replaces the inherited value (so a subtree can narrow or change the keep-set); lang files still add on top of whatever it resolves to.

Timestamps. When timestamps are on (globally with -t/--timestamps, or for a directory via its config), editing, adding, or removing a .nudebomb.yaml re-processes its directory tree on the next run, so a config change never leaves stale files behind. Re-checking an already-stripped file is a fast no-op.

Lang Files (deprecated)

Deprecated. Lang files are superseded by Directory Config Files. Nudebomb now migrates them automatically: on each run it rewrites every lang file it walks into a .nudebomb.yaml (creating one, or adding the languages to an existing one) and deletes the lang file. The migrated config records the directory's full effective keep-set, so results don't change. Dry runs (--dry-run) migrate nothing.

Lang files let you specify additional languages to keep on a per-directory basis. This is useful when your collection spans multiple languages — you want most content to keep English, but a specific show to also keep Japanese.

How They Work

Place a file named lang, langs, .lang, or .langs in any directory. The file contains a comma-separated list of ISO 639 language codes:

jpn

Nudebomb walks up the directory tree from each MKV file, collecting languages from every lang file it finds. The final set of languages to keep is the union of --languages, all lang file languages from the current directory up to the top-level path, and any online lookup results.

Example

/mnt/tv/
  .lang          # contains: eng
  GI Robot/
    Season 1/
      episode.mkv    # keeps: eng, und
  Anime Show/
    .lang            # contains: jpn
    Season 1/
      episode.mkv    # keeps: eng, jpn, und

Online Language Lookup

When no lang files contribute additional languages for a file, nudebomb can look up the original language of the media from online databases and add it to the languages to keep. This requires an API key.

TMDB (The Movie Database)

Works for both movies and TV series. Get an API key at themoviedb.org.

nudebomb -rl eng --tmdb-api-key YOUR_KEY --media-type movie /mnt/movies

TVDB (TheTVDB)

Specialized for TV series. Get an API key at thetvdb.com. When both keys are configured and --media-type tv is set, TVDB is tried first for TV content.

nudebomb -rl eng --tvdb-api-key YOUR_KEY --media-type tv /mnt/tv

Filename Parsing

Nudebomb parses media filenames to extract titles, years, and database IDs. For best results, use standard naming conventions:

  • Movies: Movie Title (2024).mkv or Movie.Title.2024.BluRay.mkv
  • TV: Show Name S01E02.mkv or Show.Name.1x02.mkv

You can embed database IDs in curly braces for exact matching:

  • {tmdb-696} — TMDB ID
  • {imdb-tt022345} — IMDB ID (looked up via TMDB)
  • {tvdb-5780} — TVDB ID

Example: {tvdb-1234} S01E01.mkv

Caching

Lookup results are cached in ~/.cache/nudebomb/ to avoid redundant API calls. Cache entries with a found language expire after a year. Entries where no language was found expire after --cache-expiry-days (default: 30) and are re-queried.

Dot Color Key

When running at default verbosity, nudebomb prints single characters to indicate progress:

Char Meaning
. MKV skipped (ignored, already stripped, or cache hit)
. (green) Skipped because timestamp unchanged
O Online lookup succeeded
x Online lookup returned no result
X Online lookup error or rate limited

Use -vv for full text descriptions instead of dots.

Development

Source code is hosted at GitHub.

Inspiration

Nudebomb is a radical fork of mkvstrip. It adds recursion, lang files, timestamps, online language lookup, and more configuration options.

Metadata

Release files for nudebomb 1.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nudebomb 1.7.0
File Size Uploaded
nudebomb-1.7.0.tar.gz 5.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for nudebomb 1.7.0
File Interpreter ABI Platform
nudebomb-1.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 5.4 MB

Release files / nudebomb-1.7.0.tar.gz

Download URL nudebomb-1.7.0.tar.gz
Size 5.4 MB
Tags Source
SHA-256 checksum
How to use checksums
b1256a007789746f68ba2adc60a0bb28f2a4b9a99714e925a4ffc56c9dea4e14
BLAKE2b-256 checksum
How to use checksums
b80d5689ed1b91e7db27b50af906bfb0596096a1648ee845d45ad363ddddcee5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / nudebomb-1.7.0-py3-none-any.whl

Download URL nudebomb-1.7.0-py3-none-any.whl
Size 61.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b73a9c0c647c8c1898f0bda74496e2dfdbf7590b08f50a57b2355dac887a6fdf
BLAKE2b-256 checksum
How to use checksums
f6c76dd2bccf460e01f58a128a05a9a2682e8a7488aaadb81adcdec6c0ee54ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

4.4.5

2 release files

4.4.4

2 release files

1.8.0

2 release files

This release

1.7.0 This release

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.4.9

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.14

2 release files

0.3.13

2 release files

0.3.10

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.0

2 release 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