Overview:
The amc script will automatically organize your media. It's a simple command-line tool that can be called manually or by other tools on one or many files. It'll fully automatically organize your TV shows and movies and is smart enough to detect what is what. The script will only touch video/subtitle files and will leave everything else as is.

Unrar archives

Group movies and episodes and then handle them separately (auto-detect episode/movie files)

Fetch subtitles and transcode to SubRip/UTF-8

Copy and Organize episodes, movies and music files into folders and rename files properly

Movies will be sorted into {output}/Movies/Name (Year)/Name (Year) [CD123].ext

If you run this script automatically in intervals every hour or every day, then you must set --def excludeList or you will get banned.

Options:--def music=y Process music files as well. Disabled by default.--conflict skip Never override existing files if the same media is downloaded multiple times--conflict auto Override existing media only if new media is better--def subtitles=en,de,fr Download subtitles for the given languages--def artwork=y Fetch artwork/nfo--def extras=y Generate *.url files and fetch all available backdrops--def kodi=host[:port] Tell the given Kodi/XBMC instance to rescan it's library--def plex=host:token Tell the given Plex instance to rescan it's library. Plex Home instances require an authentication token.--def emby=host:apikey Tell the given Emby instance to rescan it's library.--def pushover=userkey[:apikey] Send update notifications to your devices via Pushover. It is recommended that you create your own API key.--def pushbullet=apikey Send full reports to all your PushBullet devices--def gmail=username:password Use the following gmail account to send and receive full reports. You must use an App Password for security reasons. Linux / BSD / macOS users may prefer to use the send-email-log bash script to capture the entire console output.--def mail=host:port:from[:username:password] Send email via private mail server--def mailto=email Send report to the given email address (optional, email to yourself if not set)--def reportError=y Report errors via email--def storeReport=y Save reports to local filesystem--def extractFolder=/path/to/folder Extract archives to this folder--def skipExtract=y Do not extract archives--def deleteAfterExtract=y Delete archives after extraction--def clean=y Automatically remove empty folders and clutter files that may be left behind after moving the video files, or temporary extracted files after copying--def exec="echo {quote f}" Run program on newly processed files--def unsorted=y Move media files that cannot be identified to a separate folder--def ignore=regex Ignore filepaths that match the given regular expression(case-insensitive by default)--def minFileSize=0 Only process video files larger than the given number (in bytes). Defaults to 50 MB.--def minLengthMS=0 Only process videos longer than the given number (in milliseconds). Defaults to 10 minutes.--def excludeList=amc.txt Keep a list of previously processed files to be ignored in future runs (if you run this script on the same files repeatedly you must enable this option)

Change how files will be organized and renamed:
This script uses multiple format expressions, so the simple --format option is not supported. You can override the default naming schemes via --defseriesFormat, animeFormat or movieFormat. Relative paths will be resolved against --output and you can use absolute paths if you want to use multiple drives.

Make sure that you understand how format expressions work, and what bindings like {n} or {fn} mean.

Use the @/path/to/file syntax to read complex arguments from a text file.

Common Problems

The folder paths to Location of Downloaded Files (--output)must not end with backslash \ because the value gets passed through as the %D token. So the final backslash \ will escape the double-quote " and mess up everything.

It is recommended to use / as separator and not \ since it's also used to escape characters, e.g. --output "X:\" will mess up the cmdline in unexpected ways.

You can (and should) force Movie/Series/Anime mode or force ignore files via labels, e.g. label as Movie to force TheMovieDB, Series to force TheTVDB, Anime to force AniDB, or other to ignore all files. Alternatively, folder names such as Movies/TV Shows/Anime may also be used to force a specific mode.

Anime are inherently TV Shows, so Anime will only be detected as Anime and processed with AniDB if the files have Anime-like characteristics.

If you use more than one Kodi / Plex you can specify multiple hosts like this --def xbmc=host1,host2,host3,etc.

Use --conflict fail to make the script terminate on any conflicts or failures rather than gracefully ignore these errors and continue.

You must not use your download folder %D (or any other folder inside) as --output folder.

You must not use the filesystem root (e.g. E:\ or /) as input or --output folder.

Calling -script fn:amc means that it will automatically fetch the script from GitHub so it will auto-update but you won't be able to modify it.

Advanced Fine-Tuning
You can (and should)force Movie/Series/Anime mode by setting --def ut_label accordingly, and you can further define your own --filter rules to fine-tune matching to your exact needs, and avoid mismatches. For example, if one show is confused with another due to bad naming or missing data you can simply exclude the bad one, or if you only process recently aired episodes you could exclude any episode of any show that has been aired for more than a few days.

e.g. if you only process recently aired episodes you can virtually guarantee 100% auto-detection accuracy by adding simple filter rules such as these:

--filter rules are extremely flexible so more complex scenarios, such as applying certain filters only for certain labels or files, is fully supported.

Troubleshooting
If something is not working, first read the Notes above, then just run the command manually in a new console window and see what happens. You CANNOT run the command without replacing the VARIABLES. The variables have to be replaced with actual values first. You can find the actual cmdline call in the µTorrents Logger tab so you can just copy it from there. You may need to enable the Logger tab first (just right-click one of the other tabs like Info).

*** If you need help start a new thread and always include cmdline output! ***

Feedback
I'd love to get some feedback on how well this script works for everybody. Should work perfectly for most, but there's always tricky cases that might not be covered yet. Also if you've set the script up to work with deluge, transmission, cron, automator, etc I'd like to hear from you.

Since the utorrent-postprocess integration as described above only works on Windows you might be wondering how to set things up on Linux or Mac with other bittorrent clients. Here's a little tutorial how to set this up with Transmission BitTorrent Client.