Skip to main content

(Multi)mediasorter

Inspired by https://github.com/joshuaboniface/mediasorter, rewritten from scratch with asyncio, enhanced pattern matching and packaged for easier installation/usage.

"mediasorter is a tool to automatically "sort" media files from a source naming format into something nicer for humans to read/organize, and for tools like Jellyfin to parse and collect metadata for. It uses The Movie DB for movie metadata and TVMaze for TV metadata to obtain additional information, then performs the "sort" via a user-selectable mechanism. In this aspect it seeks to be a replacement for FileBot and other similar tools."

See the mediasorter-server project for a simple (yet useful) web app frontend.

Installation

  1. Install from PyPI.

    pip install multimediasorter
    
  2. Bootstrap a default configuration file, you will be prompted for your TMDB api key.

    mediasorter --setup
    
  3. Edit the configuration file with your TMDB API key (otherwise only TV shows searches will work).

  4. See --help for more details.

    mediasorter --help
    

Usage

CLI args

You can specify a folder-to-be-sorted manually with the first positional argument. By default, mediasorter tries to figure out the media type (auto), it then sorts TV show and movies to their respective folders (if both arguments are used) or into a one single common folder (if only single destination folder is specified).

mediasorter sort -m auto ./tests/test_data/ ~/Media/Series ~/Media/Movies

Configuration

You can preconfigure folders to be sorted in your configuration YAML. See the info command to find out what is configured and where to find your configuration file.

mediasorter info

Then simply append entries to the scan_sources section

# Use this to configure what directories should be sorted instead of the CLI argument(s).
scan_sources:

  - src_path: ~/Downloads-01
    media_type: auto  # force only a specific media type tv/movie/auto
    tv_shows_output: ~/Media/TV  # where to put recognized TV shows
    movies_output: ~/Media/Movies

  - src_path: ~/Downloads-02
    media_type: auto
    tv_shows_output: ~/Media/TV
    movies_output: ~/Media/Movies

Search Overrides

Sometimes, the name of a piece of media, as extracted from the file, will not return proper results from the upstream metadata providers. If this happens, mediasorter includes an option in the configuration file to specify search overrides. For example, the TV show "S.W.A.T." does not return sensible results, so it can be overridden like so:

search_overrides:
   "s w a t": "swat"
   # ...

There's also a public .yaml with already discovered overrides in the root of this repository. mediasorter uses it in conjunction with all the entries in the local configuration file. PRs are welcomed!

Metadata

Release files for multimediasorter 2.0.7

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

Source distribution (sdist)

Source distribution for multimediasorter 2.0.7
File Size Uploaded
multimediasorter-2.0.7.tar.gz 21.5 kB Details

Built distribution (wheel)

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

Total release size: 47.5 kB

Release files / multimediasorter-2.0.7.tar.gz

Download URL multimediasorter-2.0.7.tar.gz
Size 21.5 kB
Tags Source
SHA-256 checksum
How to use checksums
eefa987e04d1fca6d1b6075045debab56818f32d4ca9933693c01745c036052c
BLAKE2b-256 checksum
How to use checksums
7702080822189aa8c5c9441d3d30774293ce66a8fa0db86c8adbd34f2485685c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / multimediasorter-2.0.7-py3-none-any.whl

Download URL multimediasorter-2.0.7-py3-none-any.whl
Size 26.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9f213e5a2be4c34e8d3117f782d92754bd56bca53c4064b079af3777e079bebc
BLAKE2b-256 checksum
How to use checksums
f5bda3a1076bb3648749c65864c7a90b52310412614649e9ba350a3e4f1bc6f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

2.1.8

2 release files

2.1.7

2 release files

2.1.6

2 release files

2.1.5

2 release files

2.1.4

2 release files

2.1.3

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

1 release file

2.0.9

2 release files

This release

2.0.7 This release

2 release files

2.0.6

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.9

2 release files

1.0.8

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