dockerized sickbeard_mp4_automator by mdhiggins
1.1K
Automatically converts media files downloaded by various programs to mp4 files, and tags them with the appropriate metadata from theTVDB or TMDB.
Works on Windows, OSX, and Linux
Media Managers Supported:
Downloaders Supported:
Note: Windows users should enter commands in Powershell - using '<' doesn't work in cmd
VC for Python 2.7 (Windows Users Only) - Download and install - http://www.microsoft.com/en-us/download/details.aspx?id=44266setuptools - https://pypi.python.org/pypi/setuptools#installation-instructionsrequests - Run pip install requestsrequests security package - Run pip install requests[security]requests-cache - Run pip install requests-cachebabelfish - Run pip install babelfishguessit - Run pip install "guessit<2" to use manual.py (requires guessit version 1, version 2 is a complete rewrite, still in alpha, and not backwards compatible)subliminal- Run pip install "subliminal<2" to enable automatically downloading subtitlesstevedore - Run pip install stevedore==1.19.1 (requires stevedore version 1.19.1. This will be automatically installed with subliminal, so if subliminal is installed run pip uninstall stevedore then pip install stevedore==1.19.1)dateutil - Run pip install python-dateutil (this will be automatically installed with subliminal)deluge-client Run pip install deluge-client if you plan on using Delugeqtfaststart Run pip install qtfaststart to enable moving moov atomffmpeg = Full path to FFMPEG.exeffprobe = Full path to FFPROBE.exethreads = Number of threads for FFMPEG to use, default 0 (auto)output_directory = you may specify an alternate output directory. Leave blank to use the same directory that the source file is in. All processing will be done in this location. (Do not use for 'Automatically Add to iTunes' folder, iTunes will add prematurely, use move_to)copy_to = you may specify additional directories for the final product to be replicated to. This will be the last step performed so the file copied will be fully processed. Directories may be separated with a | charactermove_to = you may specify one final directory to move the completed file. (Use this option for the 'Automatically Add to iTunes' folder)output_extension = mp4/m4v (must be one of these 2)output_format = mp4/mov (must be one of these 2, mov provides better compatibility with iTunes/Apple, mp4 works better with other mobile devices)delete_original = True/Falserelocate_moov = True/False - relocates the MOOV atom to the beginning of the file for better streamingios-audio = creates a 2nd copy of an audio stream that will be iOS compatible (AAC Stereo) if the normal output will not be. If a stereo source stream is detected with this option enabled, an AAC stereo stream will be the only one produced (essentially overriding the codec option) to avoid multiple stereo audio stream copies in different codecs. Instead of 'true' you may also set this option to a specific codec to override the default.ios-first-track-only = Applies the ios-audio option only to the first audio track encountered in the source video file. This prevents making dual audio streams for additional alternative language codecs or commentary tracks that may be present in the source file.ios-audio-filter = Applies FFMPEG audio filter option to ONLY the iOS audio channels created by the script. iOS audio counterpart to the audio-filter option below.ios-move-last = Rearranges the iOS audio track to be after the converted track instead of first and changes the default disposition accordinglymax-audio-channels = Sets a maximum number of audio channels. This may provide an alternative to the iOS audio option, where instead users can simply select the desired output codec and the max number of audio channels without the creation of an additional audio track.use-hevc-qsv-decoder = Enable HEVC decoding using QSV on supported Intel chips. 6th Generation skylake and newer.enable_dxva2_gpu_decode = Enable GPU decoding by using DXVA2 - Windows only. Will automatically fallback to cpu decoding when it encounters a video that it cannot decode due to unsupported pixel/color/codec. Enabling this option will disable qsv decoding of hevc and h264.video-codec = set your desired video codecs. May specify multiple comma separated values (ex: h264, x264). The first value specified will be the default conversion choice when an undesired codec is encountered; any codecs specified here will be remuxed/copied rather than converted.video-bitrate = allows you to set a maximum video bitrate in Kbps. If the source file exceeds the video-bitrate it will be transcoded to the specified video-bitrate, even if they source file is already in the correct video codec. If the source file is in the correct video codec and does not exceed the video-bitrate setting, then it will be copied without transcoding. Leave blank to disable this setting.video-crf = allows you to set the CRF which will override the video bitrate setting for those that prefer CRF. Video-bitrate setting will still be used to determine a maximum bitrate that will trigger transcoding.video-max-width = set a max video width to downsize higher resolution video files. Aspect ratio will be preserved.video-profile = set the video profile. Can use multiple comma separated values to whitelist multiple profiles, first profile will be default conversion choice. Leave blank to disable.h264-max-level = set your max h264 level. Use the decimal format. Levels lower than the specified value, if otherwise appropriate, will be copied without transcoding. Example - 4.0.pix_fmt = set the video pix_fmt. If you don't know what this is just leave it blank. Can use multiple comma separated values to whitelist multiple formats, first format will be default conversion choice.audio-codec = set your desired audio codecs. May specify multiple comma separated values (ex: ac3, aac). The first value specified will be the default conversion choice when an undesired codec is encountered; any codecs specified here will be remuxed/copied rather than converted.audio-channel-bitrate = set the bitrate for each audio channel. Default is 256. Setting this value to 0 will attempt to mirror the bitrate of the audio source, but this can be unreliable as bitrates vary between different codecs.audio-language = 3 letter language code for audio streams you wish to copy. Leave blank to copy all. Separate multiple audio streams with commas (ex: eng,spa)audio-default-language = If an audio stream with an unidentified/untagged language is detected, you can default that language tag to whatever this value is (ex: eng). This is useful for many single-audio releases which don't bother to tag the audio stream as anythingaudio-filter = Applies FFMPEG audio filter. Make sure you specify all parameters as you would using the -af option with FFMPEG command lineaac_adtstoasc = Applies the aac_adtstoasc filter to AAC channels being copied. Useful if your source of mkv's uses raw ADTS AAC containers but can cause some playback issues with certain audio encodersaudio-copy-original = Copies the original audio stream to the destination regardless of codec to preserve it. Will not redundantly copy the steam if its already a valid/supported codecaudio-first-track-of-language = Adds only the first occurance of a specific language that is included in your audio-lanuage setting. Subsequent tracks of the same language will be skipped. Useful for eliminating commentary tracks.subtitle-codec = set your desired subtitle codec. If you're embedding subs, mov_text is the only option supported. If you're creating external subtitle files, srt or webvtt are accepted.subtitle-language = same as audio-language but for subtitles. Set to nil to disable copying of subtitles.subtitle-language-default = same as audio-language-default but for subtitlesconvert-mp4 = forces the script to reprocess and convert mp4 files as though they were mkvs. Good if you have old mp4's that you want to match your current codec configuration. Caution: Set ios-audio to False when reprocessing files to avoid adding multiple iOS audio streams.fullpathguess = True/False - When manually processing a file, enable to guess metadata using the full path versus just the file name. (Files shows placed in a 'Movies' folder will be recognized as movies, not as TV shows for example.)tagfile = True/False - Enable or disable tagging file with appropriate metadata after encoding.tag-language = en - Set your tag language for TMDB/TVDB entries metadata retrieval. Use either 2 or 3 character language codes.download-artwork = Poster/Thumbnail/False - Enabled downloading and embeddeding of Season or Movie posters and embeddeding of that image into the mp4 as the cover image. For TV shows you may choose between the season artwork or the episode thumbnail by selecting the corresponding option.embed-subs = True/False - Enabled by default. Embeds subtitles in the resulting MP4 file that are found embedded in the source file as well as external SRT/VTT files. Disabling embed-subs will cause the script to extract any subtitles that meet your language criteria into external SRT/VTT files. The script will also attempt to download SRT files if possible and this feature is enabled.embed-only-internal-subs = True/False - Disabled by default. Embeds only internal subtitle tracks, will skip all external subtitles. Caution: embed-subs must be enabled for this option to work.download-subs = True/False - When enabled the script will attempt to download subtitles of your specified languages automatically using subliminal and merge them into the final mp4 file.
YOU MUST INSTALL SUBLIMINAL AND ITS DEPENDENCIES FOR THIS TO WORK. You must run pip install subliminal in order for this feature to be enabled.sub-providers = Comma separated values for potential subtitle providers. Must specify at least 1 provider to enable download-subs. Providers include podnapisi thesubdb opensubtitles tvsubtitles addic7edpreopts = Additional unsupported options that go before the rest of the FFMPEG parameters, comma separated (Example -preset,medium)postopts = Additional unsupported options that go after the rest of the FFMEPG parameters, comma separated as aboveC:\\Python27\\python C:\\Scripts\\postConversion.pyhost - default localhost - Sick Beard host addressport - default 8081 - Sick Beard portssl - 0/1api_key - Set this to your Sickbeard API key (options -> general, enable API in Sick Beard to get this key)web_root - Set your Sickbeard webrootuser - Usernamepassword - PasswordC:\\Python27\\python.exe C:\\sickbeard_mp4_automator\\postConversion.py/usr/bin/python /home/user/sickbeard_mp4_automator/postConversion.pyhost - default localhost - Sickrage host address (localhost)port - default 8081 Sickrage portssl - 1 if enabled, 0 if notapi_key - Set this to your Sickrage API keyweb_root - Set your Sickrage webrootuser - Usernamepassword - Passwordhost = Sonarr host address (localhost) #Settings/General/Start-Upport = Sonarr port (8989) #Settings/General/Start-Upssl = 1 if enabled, 0 if not #Settings/General/Securityapikey = Sonarr API Key (required) #Settings/General/Securityweb_root = URL base empty or e.g. /tv #Settings/General/Start-Upname - postSonarrOn Grab - NoOn Download - YesOn Upgrade - YesOn Rename - NoPath - Full path to your python executableArguments - Full path to postSonarr.pyPath - Full path to postSonarr.pyArguments - Leave blankhost = Radarr host address (localhost) #Settings/General/Start-Upport = Radarr port (7878) #Settings/General/Start-Upssl = 1 if enabled, 0 if not #Settings/General/Securityapikey = Radarr API Key (required) #Settings/General/Securityweb_root = URL base empty or e.g. /tv #Settings/General/Start-Upname - postRadarrOn Grab - NoOn Download - YesOn Upgrade - YesOn Rename - NoPath - Full path to your python executableArguments - Full path to postRadarr.pyPath - Full path to postRadarr.pyArguments - Leave blankhost - default localhost - CouchPotato host addressport - default 5050 - CouchPotato port (5050)ssl - 1 if enabled, 0 if notapi_key - CouchPotato API Keyusername - your CouchPotato usernamepassword - your CouchPotato passwordmain.py in the setup\PostProcess folder
C:\\Scripts\\custom_plugins directory
custom_plugins directory.pyc files you find.Run Every to 0Force Every to 0Settings > Downloaders configure your labels or categories to match what you have configured in your respective downloader.localhost:6789SettingsNZBGETPOSTPROCESS 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 destinationCP_CAT - default couchpotato - category of downloads that will be passed to CouchPotatoSONARR_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 mp4_automator is called.SABNZBD section of autoProcess.ini
convert - True/False - Allows for conversion of files before passing back to the respective download manager.sickbeard-category - default sickbeard - category that will be sent to Sickbeard for additional processing when download is completesickrage-category - default sickrage - category that will be sent to Sickrage for additional processing when download is completecouchpotato-category - default couchpotato - category that will be sent to Couch Potato for additional processing when download is completesonarr-category - default sonarr - category that will be sent to Sonarr for additional processing when download is completebyapss-category - default bypass - category that should be assigned to torrents that will not be sent anywhere when download is complete. Useful if you wish to convert files without additional processingSettings > Categoriesname to match the settings from the SABNZBD section of autoProcess.ini
sickbeardsickragecouchpotatosonarrbypasspip install requestsRun Program option
Options > Preferences > Advanced > Run ProgramuTorrentPostProcess.py with command line parameters: %L %T %D %K %F %I %N in that exact order.convert - True/False. Allows for conversion of files before passing back to the respective download manager.sickbeard-label - default sickbeard - uTorrent label that should be assigned to torrents that will be sent to Sickbeard for additional processing when download is complete.sickrage-label - default sickrage - uTorrent label that should be assigned to torrents that will be sent to Sickrage for additional processing when download is complete.couchpotato-label - default couchpotato - uTorrent label that should be assigned to torrents that will be sent to Couch Potato for additional processing when download is complete.sonarr-label - default sonarr - uTorrent label that should be assigned to torrents that will be sent to Sonarr for additional processing when download is complete.bypass-label - default bypass - label that should be assigned to torrents that will not be sent anywhere when download is complete. Useful if you wish to convert files without additional processing.webui - True/False. If True the script can change the state of the torrent.action_before - stop/pause or any other action from http://help.utorrent.com/customer/portal/articles/1573952-actions---webapiaction_after - start/stop/pause/unpause/remove/removedata or any other action from http://help.utorrent.com/customer/portal/articles/1573952-actions---webapihostname - your uTorrent Web UI URL, eg http://localhost:8080/ including the trailing slash.username - your uTorrent Web UI username.password - your uTorrent Web UI password.pip install gevent%appdata%\Roaming\Deluge in Windows/var/lib/deluge/.config/deluge/ in Linuxauth file<username>:<password>:<level>. Replace and with your choice and level with your desired authentication level. Default level is 10. Save auth.
sampleuser:samplepass:108112delugeExecute plugin
Torrent CompletedelugePostProcess.py or delugePostProcess.bat for Windows users.autoProcess.ini
sickbeard-label - Deluge label that should be assigned to torrents that will be sent to Sickbeard for additional processing when download is complete.couchpotato-label - Deluge label that should be assigned to torrents that will be sent to Couch PotatoContent type
Image
Digest
Size
300.4 MB
Last updated
over 7 years ago
docker pull padic/sickbeard_mp4_automator