Automatically convert video files to a standardized format with metadata tagging to create a beautiful and uniform media library
Automatically converts media files downloaded by various programs to a standardized format, and tags them with the appropriate metadata from TMDB if the container supports tagging.
Works on Windows, OSX, and Linux. Despite the name works with much more than just Sickbeard and handles more than MP4s
Two official Docker containers are maintained for Radarr and Sonarr with SMA included. These are meant to work with completed download handling enabled. See the respective Docker Hub pages for details
setup\autoProcess.ini.sample
to autoProcess.ini
and place inside your config
directory (or attempt to run the script which will generate a new config file if absent)name
- postSonarrOn Grab
- NoOn Download
\ On Import
- YesOn Upgrade
- YesOn Rename
- NoOn Movie Delete
- NoOn Movie File Delete
- NoOn Health Issue
- NoPath
- Full path to your python executableArguments
- Full path to postSonarr.py
name
- postRadarrOn Grab
- NoOn Download
\ On Import
- YesOn Upgrade
- YesOn Rename
- NoOn Movie Delete
- NoOn Movie File Delete
- NoOn Health Issue
- NoPath
- Full path to your python executableArguments
- Full path to postRadarr.py
C:\\Python27\\python C:\\Scripts\\postSickbeard.py
C:\\Python27\\python.exe C:\\sickbeard_mp4_automator\\postSickbeard.py
/usr/bin/python /home/user/sickbeard_mp4_automator/postSickbeard.py
localhost:6789
Settings
NZBGETPOSTPROCESS
option at the bottom of the left hand navigation panel and configure the options
MP4_FOLDER
- default ~/sickbeard_mp4_automator/
- Location of the script. Use full path with trailing backslash.SHOULDCONVERT
- True
/False
- Convert file before passing to destinationSONARR_CAT
- default sonarr
- category of downloads that will be passed to SonarrSICKBEARD_CAT
- default sickbeard
- category of downloads that will be passed to SickbeardSICKRAGE_CAT
- default sickrage
- category of downloads that will be passed to SickrageBYPASS_CAT
- default bypass
- category of downloads that may be converted but won’t be passed on furtherPostScript
to NZBGetPostProcess.py to ensure SMA is called.Not required if using Completed Download Handling with Sonarr/Radarr
Settings > Categories
name
to match the settings from the SABNZBD
section of autoProcess.ini
sickbeard
sickrage
sonarr
bypass
Not required if using Completed Download Handling with Sonarr/Radarr
%appdata%\Roaming\Deluge
in Windows/var/lib/deluge/.config/deluge/
in Linuxauth
file<username>:<password>:<level>
. Replace 10
. Save auth.
sampleuser:samplepass:10
8112
deluge
Execute
plugin
Torrent Complete
delugePostProcess.py
or a batch file wrapper that passes command line arguments for Windows users with difficulty executing python files directlyNot required if using Completed Download Handling with Sonarr/Radarr
Run Program
option
Options > Preferences > Advanced > Run Program
uTorrentPostProcess.py
with command line parameters: %L %T %D %K %F %I %N
in that exact order.Not required if using Completed Download Handling with Sonarr/Radarr
Run Program
option
Tools > Options > Run external program on torrent completion
qBittorrentPostProcess.py
with command line parameters: "%L" "%T" "%R" "%F" "%N" "%I"
in that exact order.Not required if using Completed Download Handling with Sonarr/Radarr
Send a Plex notification as the final step when all processing is completed. This feature prevents a file from being flagged as “in use” by Plex before processing has completed.
Settings > Server > Library
and disable Update my library automatically
and Update my library periodically
.If you have secure connections enabled with Plex you will need to add your local IP addresss that the refresh requests are coming from to allow them to trigger the refresh, otherwise you will get an HTTP error. You can alternatively not force encryption by changing Secure Connections
from Required
to Preferred
but this is not recommended as its less secure.
Found under Plex Server Settings > Network > Advanced
If for some reason you need to override the path to autoProcess.ini (for virtual environments, containers, etc) you can use the environment variable SMA_CONFIG
to the absolute path
To run the script manually, simply run the manual.py file and follow the prompts it presents.
If you wish to run it via the command line (good for batch operations) follow this format:
Help output
manual.py -h
usage: manual.py [-h] [-i INPUT] [-a] [-tv TVDBID] [-s SEASON] [-e EPISODE]
[-imdb IMDBID] [-tmdb TMDBID] [-nm] [-nc] [-nd]
Manual conversion and tagging script for sickbeard_mp4_automator
optional arguments:
-h, --help show this help message and exit
-i INPUT, --input INPUT
The source that will be converted. May be a file or a
directory
--config Specify an alternate configuration file location
-a, --auto Enable auto mode, the script will not prompt you for
any further input, good for batch files. It will guess
the metadata using guessit
-tmdb TMDBID, --tmdbid TMDBID
Specify the TMDB ID for media
-tvdb TVDBID, --tvdbid TMBDID
Specify the TVDB ID for media
-imdb IMDBID, --imdbid IMDBID
Specify the IMDB ID for media
-s SEASON, --season SEASON
Specifiy the season number
-e EPISODE, --episode EPISODE
Specify the episode number
-nm, --nomove Overrides and disables the custom moving of file
options that come from output_dir and move-to
-m, --moveto Override move-to value setting in autoProcess.ini
changing the final destination of the file
-nc, --nocopy Overrides and disables the custom copying of file
options that come from output_dir and move-to
-nt, --notag Overrides and disables tagging when using the
automated option
-to, --tagonly Only tag without conversion
-nd, --nodelete Overrides and disables deleting of original files
-pr, --preserverelative
Preserves relative directories when processing
multiple files using the copy-to or move-to
functionality
-pse, --processsameextensions
Overrides process-same-extensions setting in
autoProcess.ini enabling the reprocessing of files
-fc, --forceconvert Overrides force-convert setting in autoProcess.ini and
also enables process-same-extenions if true forcing the conversion of files
-oo, --optionsonly Display generated conversion options only, do not perform conversion
-cl, --codeclist Print a list of supported codecs and their paired FFMPEG encoders
-pa, --processedarchive
Specify a processed list/archive so already processed files are skipped
Examples
Movies (using IMDB ID):
manual.py -i mp4path -imdb imdbid
Example: manual.py -i "C:\The Matrix.mkv" -imdb tt0133093
Movies (using TMDB ID)
manual.py -i mp4path -tmdb tmdbid
Example: manual.py -i "C:\The Matrix.mkv" -tmdb 603
TV
manual.py -i mp4path -tvdb tmbdid -s season -e episode
Example: manual.py -i "C:\Futurama S03E10.mkv" -tvdb 73871 -s 3 -e 10
Auto Single File (will gather movie ID or TV show ID / season / spisode from the file name if possible)
manual.py -i mp4path -a
Example: manual.py -i "C:\Futurama S03E10.mkv" -a
Directory (you will be prompted at each file for the type of file and ID)
manual.py -i directory_path
Example: manual.py -i C:\Movies
Automated Directory (The script will attempt to figure out appropriate tagging based on file name)
manual.py -i directory_path -a
Example: manual.py -i C:\Movies -a
Process a directory but manually specific TVDB ID (Good for shows that don't correctly match using the guess)
manual.py -i directory -a -tvdb tvdbid
Example: manual.py -i C:\TV\Futurama\ -a -tvdb 615
You may also simply run manual.py -i 'C:\The Matrix.mkv
and the script will prompt you for the missing information or attempt to guess based on the file name.
You may run the script with a --auto
or -a
switch, which will let the script guess the tagging information based on the file name, avoiding any need for user input. This is the most ideal option for large batch file operations.
The script may also be pointed to a directory, where it will process all files in the directory. If you run the script without the -a
switch, you will be prompted for each file with options on how to tag, to convert without tagging, or skip.
To use your own cover art instead of what the script pulls from TMDB or TVDB, simply place an image file in the same directory as the input video with the same name before processing and it will be used. Must be jpg
or png
To import external subtitles, place the .srt file in the same directory as the file to be processed. The srt must have the same name as the input video file, as well as the language code for which the subtitle is. Subtitle importing obeys the langauge rules set in autoProcess.ini, so languages that aren’t whitelisted will be ignored.
Naming example:
input mkv - The.Matrix.1999.mkv
subtitle srt - The.Matrix.1999.eng.srt
This project makes use of, integrates with, or was inspired by the following projects: