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

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: mnamer-1.4.2.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for mnamer-1.4.2.tar.gz
Algorithm Hash digest
SHA256 281a6e3e625f0ba4abd767113557553f2a2773b206210e517605b813d86d2af0
MD5 2b1bbafa6a87fdb2db2794150e7b7c1d
BLAKE2b-256 1cb5fa6b5445248d19b359c3746b39497d3e06b7dd627a2510d46987445d56ff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mnamer-1.4.2-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.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for mnamer-1.4.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2eaabad77ae8b73f1a61664df9f181c8dc4bbcb88851749a14352b1548eb5f8a
MD5 c735572d3c011e2cf35a4ea70236a4e6
BLAKE2b-256 c93ae771b5f69cc297b30876dc87306ab8d4b4073438ac0a5c28c01c8fdfa208

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