All Projects → mdhiggins → Sickbeard_mp4_automator

mdhiggins / Sickbeard_mp4_automator

Licence: mit
Automatically convert video files to a standardized format with metadata tagging to create a beautiful and uniform media library

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Sickbeard mp4 automator

Atomic Toolkit
AtoMiC Toolkit simplifies HTPC / Home Server setup and management on Ubuntu and Debian variants including Raspbian. It currently supports: Couchpotato, Deluged, Emby, FFmpeg, Headphones, Htpcmanager, Jackett, Kodi, Lazylibrarian, Madsonic, Mono, Mylar, Nzbget, Nzbhydra, NzbToMedia, Ombi, Plex, Plexpy, Pyload, qBittorrent, Radarr, Sabnzbd+, Sickgear, Sickrage, Sonarr, Subsonic, Transmission, Unrar, Watcher, and Webmin.
Stars: ✭ 747 (-34.59%)
Mutual labels:  radarr, sonarr, sabnzbd, qbittorrent, nzbget
Thoradia
Thoradia Add-ons Repository
Stars: ✭ 208 (-81.79%)
Mutual labels:  radarr, sabnzbd, qbittorrent, nzbget
Media Docker
all-in-one deployment and configuration for an all-in-one media server, running on docker.
Stars: ✭ 148 (-87.04%)
Mutual labels:  media, radarr, sonarr, sabnzbd
Usenet Docker
Docker-compose configuration for Sabnzbd, CouchPotato, Plex, Sonarr, Plexpy, Nzbhydra, Muximux, Radarr, NZBGet and Ombi with a Nginx proxy.
Stars: ✭ 153 (-86.6%)
Mutual labels:  radarr, sonarr, sabnzbd, nzbget
Organizr
HTPC/Homelab Services Organizer - Written in PHP
Stars: ✭ 3,605 (+215.67%)
Mutual labels:  radarr, sonarr, sabnzbd, nzbget
Heimdall
As the name suggests Heimdall Application Dashboard is a dashboard for all your web applications. It doesn't need to be limited to applications though, you can add links to anything you like.
Stars: ✭ 3,501 (+206.57%)
Mutual labels:  radarr, sonarr, sabnzbd, nzbget
Muximux
A lightweight way to manage your HTPC
Stars: ✭ 1,008 (-11.73%)
Mutual labels:  radarr, sonarr, sabnzbd, nzbget
Plexguide.com
Welcome to https://PlexGuide.com ~ Rapidly deploy multiple-hasty Docker Containers through Ansible with local or Unlimited Google HD Space!
Stars: ✭ 1,631 (+42.82%)
Mutual labels:  radarr, sonarr, sabnzbd, nzbget
Gooby
Gooby: The ultimate infinite Plex media server using a VPS and Cloud service
Stars: ✭ 230 (-79.86%)
Mutual labels:  radarr, sonarr, nzbget
Docker Compose Usenet
Docker-powered usenet pipeline
Stars: ✭ 240 (-78.98%)
Mutual labels:  radarr, sonarr, sabnzbd
Addarr
Telegram Bot for adding series/movies to Sonarr/Radarr or for changing the download speed of Transmission/Sabnzbd
Stars: ✭ 150 (-86.87%)
Mutual labels:  sonarr, sabnzbd, radarr
autobrr
Automation for downloads.
Stars: ✭ 288 (-74.78%)
Mutual labels:  sonarr, qbittorrent, radarr
live-stream-media-source-extensions
Live stream h264 encoded mp4 video on media source extensions using ffmpeg, node.js, socket.io, and express. Works in chrome, firefox, safari, and android. Not iOS compatible. Work has moved to mse-live-player repo =>
Stars: ✭ 24 (-97.9%)
Mutual labels:  ffmpeg, mp4, media
Guides
Here you will find Guides mainly for Sonarr/Radarr/Bazarr and everything related to it.
Stars: ✭ 207 (-81.87%)
Mutual labels:  radarr, sonarr, nzbget
Saltbox
Ansible-based solution for rapidly deploying a Docker containerized cloud media server.
Stars: ✭ 117 (-89.75%)
Mutual labels:  sonarr, radarr, nzbget
Lunasea
A self-hosted controller for mobile built using the Flutter framework.
Stars: ✭ 378 (-66.9%)
Mutual labels:  radarr, sonarr, sabnzbd
Cloudbox
Ansible-based solution for rapidly deploying a Docker containerized cloud media server.
Stars: ✭ 1,763 (+54.38%)
Mutual labels:  radarr, sonarr, nzbget
Unpackerr
Extracts downloads for Radarr, Sonarr, Lidarr - Deletes extracted files after import
Stars: ✭ 122 (-89.32%)
Mutual labels:  radarr, sonarr, qbittorrent
tardisIVR
No description or website provided.
Stars: ✭ 36 (-96.85%)
Mutual labels:  sonarr, sabnzbd, radarr
Ffmpegcommand
FFmpegCommand适用于Android的FFmpeg命令库,实现了对音视频相关的处理,能够快速的处理音视频,大概功能包括:音视频剪切,音视频转码,音视频解码原始数据,音视频编码,视频转图片或gif,视频添加水印,多画面拼接,音频混音,视频亮度和对比度,音频淡入和淡出效果等
Stars: ✭ 394 (-65.5%)
Mutual labels:  ffmpeg, media, mp4

SMA Conversion/Tagging Automation Script

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.

The Matrix

Works on Windows, OSX, and Linux. Despite the name works with much more than just Sickbeard and handles more than MP4s

Integration

Media Managers Supported

Downloaders Supported

Dependencies

Default Settings

  • Container - MP4
  • Video - H264
  • Audio - AAC 2.0 with additional AC3 track when source has >2 channels (ex 5.1)
  • Subtitles - mov_text

Docker

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

General Configuration

  1. Download or compile FFmpeg
  2. Rename autoProcess.ini.sample to autoProcess.ini inside your config directory (or attempt to run the script which will generate a new config file if absent)
  3. Set the configuration options to your desired output and include the path of your new FFmpeg / FFprobe binaries
  4. Run manual.py and test out a conversion
  5. Configure direct integration using the instructions below

Sonarr Setup

  1. Set your Sonarr settings in autoProcess.ini
  2. Browse to the Settings>Download Client tab and enable advanced settings [Show].
  3. Setup the postSonarr.py script via Settings > Connect > Connections > + (Add)
    • name - postSonarr
    • On Grab - No
    • On Download - Yes
    • On Upgrade - Yes
    • On Rename - No
    • Path - Full path to your python executable
    • Arguments - Full path to postSonarr.py
    • For Sonarr V3 you'll need to make a .sh or .bat file to combine your path to python and script
  4. OPTIONAL If you desire to convert the file before it is handed back to Sonarr, disable 'Completed Download Handling' in Sonarr settings and configure your download client to use its included script (scroll down to your relevant download client in the readme). The script will trigger a specific path re-scan, allowing the conversion to be completed before Sonarr starts moving stuff around. You must use either a download script or enabled Completed Download Handling. If neither are used the file will never be passed back

Radarr Setup

  1. Set your Radarr settings in autoProcess.ini
  2. Browse to the Settings>Download Client tab and enable advanced settings [Show].
  3. Setup the postRadarr.py script via Settings > Connect > Connections > + (Add)
    • name - postRadarr
    • On Grab - No
    • On Download - Yes
    • On Upgrade - Yes
    • On Rename - No
    • Path - Full path to your python executable
    • Arguments - Full path to postRadarr.py
    • For Radarr V3 you'll need to make a .sh or .bat file to combine your path to python and script
  4. OPTIONAL If you desire to convert the file before it is handed back to Radarr, disable 'Completed Download Handling' in Radarr settings and configure your download client to use its included script (scroll down to your relevant download client in the readme). The script will trigger a specific path re-scan, allowing the conversion to be completed before Radarr starts moving stuff around. You must use either a download script or enabled Completed Download Handling. If neither are used the file will never be passed back

Sickbeard Setup

  1. Open Sickbeard's config.ini in Sick Beard installation folder
    • Set "extra_scripts" value in the general section to the full path to "python postSickbeard.py" using double backslashes
      • Example: C:\\Python27\\python C:\\Scripts\\postSickbeard.py
      • Make sure this is done while Sick Beard is not running or it will be reverted
  2. Set your SickBeard settings in autoProcess.ini

SickRage Setup

  1. Open the configuration page in Sickrage and scroll down to the option labelled "Extra Scripts". Here enter the path to python followed by the full script path. Examples:
    • C:\\Python27\\python.exe C:\\sickbeard_mp4_automator\\postSickbeard.py
    • /usr/bin/python /home/user/sickbeard_mp4_automator/postSickbeard.py
  2. Set the Sickrage settings in autoProcess.ini

CouchPotato Setup

  1. Set your CouchPotato settings in autoProcess.ini
  2. Edit main.py in the setup\PostProcess folder
    • Set the path variable to the script location
    • By default it points to C:\\Scripts\\
    • Use double backslahses
  3. Copy the PostProcess directory from the setup folder included with this script to the CouchPotato custom_plugins directory
    • Navigate to the About page in CouchPotato, where the installation directory is displayed.
    • Go to this folder and copy the PostProcess folder (the whole folder, not just the contents) to the CouchPotato custom_plugins directory
    • Delete any .pyc files you find.
    • Restart CouchPotato
    • Verify in CouchPotato logs that PostProcess was loaded.
  4. If you're using one of the post download scripts ([SAB|NZBGet|uTorrent|deluge]PostProcess.py), disable automatic checking of the renamer folder, the script will automatically notify CouchPotato when it is complete to check for new videos to be renamed and relocated. Leaving this on may cause conflicts and CouchPotato may try to relocate/rename the file before processing is completed.
    • Set Run Every to 0
    • Set Force Every to 0
    • If you aren't using one of these scripts and are using an unsupported downloader, you will need to have CouchPotato periodically check the folder for files, otherwise the post downloader scripts will manually trigger a renamer scan. Using manual triggers is helpful because it prevents a coincidental renamer scan during other processing events.
  5. Configure Downloaders
    • In Settings > Downloaders configure your labels or categories to match what you have configured in your respective downloader.

NZBGet Setup

  1. Copy the script NZBGetPostProcess.py to NZBGet's script folder.
    • Default location is /opt/nzbget/scripts/
  2. Start/Restart NZBGet
  3. Configure NZBGETPOSTPROCESS
    • Access NZBGet's WebUI
      • Default localhost:6789
    • Go to Settings
    • Select 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 destination
      • CP_CAT - default couchpotato - category of downloads that will be passed to CouchPotato
      • SONARR_CAT - default sonarr - category of downloads that will be passed to Sonarr
      • SICKBEARD_CAT - default sickbeard - category of downloads that will be passed to Sickbeard
      • SICKRAGE_CAT - default sickrage - category of downloads that will be passed to Sickrage
      • BYPASS_CAT - default bypass - category of downloads that may be converted but won't be passed on further
    • Save changes
    • Reload NZBGet
  4. When assigning categories in NZBGet and your chosen media manager, ensure they match the label settings specified here so that file will be passed back to the appropriate location.
    • In the relevant category set PostScript to NZBGetPostProcess.py to ensure SMA is called.

Not required if using Completed Download Handling with Sonarr/Radarr

SABNZBD Setup

  1. Set your SABNZBD settings in autoProcess.ini
  2. Point SABNZBD's script directory to the root directory where you have extract the script.
  3. Configure categories. Categories will determine where the download is sent when it is finished
    • Settings > Categories
    • Configure name to match the settings from the SABNZBD section of autoProcess.ini
      • Default sickbeard
      • Default sickrage
      • Default couchpotato
      • Default sonarr
      • Default bypass
    • Select the SABPostProcess.py script
    • Save EACH category
  4. Verify that whatever media manager you are using is assigning the label to match the label settings specified here so that file will be passed back to the appropriate location

Not required if using Completed Download Handling with Sonarr/Radarr

Deluge Daemon Setup

  1. Create username and password for deluge daemon
    • Navigate to your deluge configuration folder
      • %appdata%\Roaming\Deluge in Windows
      • /var/lib/deluge/.config/deluge/ in Linux
    • Open the auth file
    • Add a username and password in the format <username>:<password>:<level>. Replace and with your choice and level with your desired authentication level. Default level is 10. Save auth.
      • Ex: sampleuser:samplepass:10
  2. Start/Restart deluged
    • deluged not deluge
  3. Access the WebUI
    • Default port is 8112
    • Default password is deluge
  4. Enabled the Execute plugin
    • Add event for Torrent Complete
    • Set path to the full path to delugePostProcess.py or a batch file wrapper that passes command line arguments for Windows users with difficulty executing python files directly
  5. Set your Deluge settings in autoProcess.ini
  6. Verify that whatever downloader you are using is assigning the label to match the label settings specified here so that file will be passed back to the appropriate location

Not required if using Completed Download Handling with Sonarr/Radarr

uTorrent Setup

  1. Launch uTorrent
  2. Set Run Program option
    • Go to Options > Preferences > Advanced > Run Program
    • Point to uTorrentPostProcess.py with command line parameters: %L %T %D %K %F %I %N in that exact order.
  3. Set your uTorrent settings in autoProcess.ini
  4. Verify that whatever media manager you are using is assigning the label to match the label settings specified here so that file will be passed back to the appropriate location

Not required if using Completed Download Handling with Sonarr/Radarr

qBittorrent Setup

  1. Launch qBittorrent
  2. Set Run Program option
    • Go to Tools > Options > Run external program on torrent completion
    • Point to qBittorrentPostProcess.py with command line parameters: "%L" "%T" "%R" "%F" "%N" "%I" in that exact order.
  3. Set your qBittorrent settings in autoProcess.ini
  4. Verify that whatever media manager you are using is assigning the label to match the label settings specified here so that file will be passed back to the appropriate location

Not required if using Completed Download Handling with Sonarr/Radarr

Plex Notification

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.

  1. Disable automatic refreshing on your Plex server
    • Settings > Server > Library and disable Update my library automatically and Update my library periodically.
  2. Set your Plex settings in autoProcess.ini

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 image

Override Configuration Path

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

Post Process Scripts

The script suite supports the ability to write your own post processing scripts that will be executed when all the final processing has been completed. All scripts in the ./post_process directory will be executed if the post-process option is set to True in autoProcess.ini. Scripts within the ./post_process/resources directory are protected from execution if additional script resources are required.

The following environmental variables are available for usage:

  • SMA_FILES - JSON Array of all files created by the post processing script. The first file in the array is the primary file, and any additional files are copies created by the copy-to option
  • SMA_TVDBID - TVDB ID if file processed was a TV show and this information is available
  • SMA_SEASON - Season number if file processed was a TV show
  • SMA_EPISODE - Episode number if files processed was a TV show
  • SMA_IMDBID - IMDB ID if file processed was a movie A sample script as well as an OS X 'Add to iTunes' script (iTunes.py) have been provided.

Special thanks to @jzucker2 for providing much of the initial code for this feature

Manual Script Usage

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
  -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

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.

External Cover Art

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

Import External Subtitles

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

Credits

This project makes use of, integrates with, or was inspired by the following projects:

Enjoy

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].