Skip to content


Folders and files

Last commit message
Last commit date

Latest commit



41 Commits

Repository files navigation

CAIN - Simple Media Management

Cain automatically organises your movies and TV-shows according to your configuration. Your favourite torrent/download client should call Cain after the download has finished and Cain will do the rest.

Cain is still WIP and may very well contain bugs. Please feel free to report those here


  • Fully automated media management
  • Simple to setup and easy to use
  • Plays well with your Downloader, Torrent Client or whatever else you like to use
  • FileBot under the hood - No need to reinvent the wheel



FileBot needs to be installed and the filebot executable has to be globally available.


Latest Release is available for all major operating systems as a prebuilt binary.

  1. Download and extract the archive
  2. Put the binary (cain) somewhere save and add the location to your PATH
  3. Run cain setup


Before you can use Cain you need to configure some basic things first. Cain provides some sensitive defaults to get started with.

Run cain setup to interactively configure Cain. After you finished the setup process you are pretty much ready to go. Now you can configure your Downloader and/or Torrent Client to automatically run Cain after finishing downloading.


Location: ~/.config/cain/config.yaml

  • defaultRetrievePath: Where to get the unsorted media from
    • If not specified, parameter --path is required.
  • autoUpdate: Enable/Disable automatic updates.
  • language: 2-letter language code (default: en)
  • nonStrictMatching: Enable to non strictly match for movies/tv-shows. Be aware that this could result in wrong matches.
  • cleanupAfterwards: Cain will automatically clean the remaining unused/unneeded files after moving the matched files.
  • hideBanner: If true Cain will no longer show the ascii banner before every command

Naming Schemes

Please see the FileBot Documentation for more informations on this subject.

Default Naming Schemes

  • movie: {n} ({y})/{n}
  • series/anime: {n}/Season {s.pad(2)}/{n} - {s00e00} - {t}
  • music: {n}/{album}{pi.pad(2)}{artist} - {t}


Cain can also automatically notify specific apps for changes.

  • kodi: host[:port] Tell the given Kodi/XBMC instance to rescan it's library
  • plex: host[:token] Tell the given Plex instance to rescan it's library. Plex Home instances require an authentication token.
  • emby: host:apikey Tell the given Emby instance to rescan it's library.
  • pushover: userkey Send update notifications to your devices via Pushover.
  • pushBullet: apikey Send full reports to all your PushBullet devices
  • gmail: username:password Use the following gmail account to send and receive full reports. You must use an App Password for security reasons.
  • mail: host:port:from[:username:password] Send email via custom mail server

Command line reference

  • cain setup: Configure Cain interactively.
  • cain run: Run Cain (this should idealy be run by your Download/Torrent Client)
    • --path: Where Cain should look for media to sort. This Parameter is required if DefaultRetrievePath is not set.
    • --path-env: Get path from specified environment variable.
    • --non-strict: Enable to non strictly match for movies/tv-shows. Be aware that this could result in wrong matches.


Everyone is encouraged to help improve this project. Here are a few ways you can help: