Skip to main content

A media file organiser

Project description

pypi travis_ci coverage licence code style black

mnamer logo

mnamer

mnamer (media renamer) is an intelligent and highly configurable media organization utility. It parses media filenames for metadata, searches the web to fill in the blanks, and then renames and moves them.

mnamer terminal recording

Installation

Stable Version

$ pip install mnamer

Development Version

$ pip install https://github.com/jkwill87/mnamer/archive/develop.zip

Notes

If you want to install it using system python (e.g. the one that comes with your OS, not really recommended) and get a permission error you need to use either sudo -H pip ... or pip install --user ....

Usage

mnamer target [targets ...] [options] [directives]

Options

mnamer attempts to load options from mnamer.json in the user's configuration directory, .mnamer.json in the current working directory, and then from the command line, also overriding each other in that order.

Option Arguments Description
-b, --batch batch mode; disables interactive prompts
-s, --scene scene mode; replace non ascii-alphanumerics with .
-r, --recurse show this help message and exit
-v, --verbose increases output verbosity
--blacklist pattern ignore files including these words
--max_hits number limits the maximum number of hits for each query
--extension_mask extention(s) define the extension mask used by the the file parser
--movie_api imdb or tmdb set movie api provider
--movie_destination path set movie relocation destination
--movie_template template set movie renaming template
--television_api tvdb set television api provider
--television_destination path set television relocation destination
--television_template template set television renaming template

Directives

Whereas options configure how mnamer works, directives are one-off parameters that are used to perform secondary tasks like exporting the current option set to a file.

Option Arguments Description
--config_load path import configuration from file
--config_save path save configuration to file
--id id explicitly specify movie or series id
--media movie or television override media detection
--test_run mocks the renaming and moving of files

Configuration Files

In addition to the option argument flags listed above, mnamer can also be configured via JSON configuration file(s). These are loaded and applied from the following locations, in the following order:

  1. As .mnamer.json within the current working directory (e.g. ./.mnamer.json)
  2. As mnamer.json from within the user config directory (e.g. ~/.config/mnamer.json)
  3. As .mnamer.json from the user home directory (e.g. ~/.mnamer.json)
  4. Any path explicitly passed using the --load_config directive

Templating

You have complete control of how media files are renamed using mnamer's template options:

  • you can use templating with the following options: television_destination, television_template, movie_destination, movie_template
  • metadata fields prefixed with a sigil $ found inside angle brackets with the result of a match
  • any leading or trailing whitespace will be trimmed
  • if a field can't be matched, the entire contents of the bracket are disregared

Example: SxE Episodes Format

  • television_template: <$series - >< - $seasonx><$episode - >< - $title><$extension>
  • target: ~/Downloads/Rick.and.Morty.S02E01.WEBRip.x264-RARBG.mp4
  • result: ~/Downloads/Rick and Morty - 02x01 - A Rickle in Time.mp4

Example: Missing Metadata

Note: Target file is missing group metadata field in title and will be omitted gracefully

  • television_template: <$series - >< - S$season><E$episode - >< - $group - >< - $title><$extension>
  • target: ~/Downloads/The.Orville.S01E01.1080p.WEB-DL.DD5.1.H264-RARBG.mkv
  • result: ~/Downloads/The Orville - S01E01 - Old Wounds.mkv

Example: Subdirectories

Note: If the subdirectory doesn't exist, mnamer will create it

  • movie_template: <$title ><($year)><$extension>
  • movie_destination: /media/movies/<$title ><($year)>
  • target: ~/Downloads/The.Goonies.1985.720p.BluRay.x264-SiNNERS.mkv
  • result: /media/movies/The Goonies (1985)/The Goonies (1985).mkv

Metadata Fields

Field Description
title movie or episode title
year movie release year
series tv series' name
season tv series' airing season number
episode tv series' airing episode number

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mnamer-1.4.1.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

mnamer-1.4.1-py2.py3-none-any.whl (11.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file mnamer-1.4.1.tar.gz.

File metadata

  • Download URL: mnamer-1.4.1.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.7.0

File hashes

Hashes for mnamer-1.4.1.tar.gz
Algorithm Hash digest
SHA256 26a2e040dc18db45010940f641a10ce3b51a2dddbe3a7a3e38539c75e29260e9
MD5 124e3a5a6fabdab54e74a91917b273b3
BLAKE2b-256 a3a94471d0c39882c8677a83c32e25d50746a6318554d44f343b20d11e102027

See more details on using hashes here.

File details

Details for the file mnamer-1.4.1-py2.py3-none-any.whl.

File metadata

  • Download URL: mnamer-1.4.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.7.0

File hashes

Hashes for mnamer-1.4.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 fea6ef0793b644e11047008093693004d2d4ac45db92d6e6f4803995e3e45a08
MD5 c07bcf4925ef9f97044201f84dcef06e
BLAKE2b-256 92ce4df6c83363a8291f042991c0afafcc490c4f9d88707b65a52d287cfb11fc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page