{"id":13510862,"url":"https://github.com/mdhiggins/sickbeard_mp4_automator","last_synced_at":"2025-05-14T08:09:37.283Z","repository":{"id":6977273,"uuid":"8231332","full_name":"mdhiggins/sickbeard_mp4_automator","owner":"mdhiggins","description":"Automatically convert video files to a standardized format with metadata tagging to create a beautiful and uniform media library","archived":false,"fork":false,"pushed_at":"2025-05-02T08:49:42.000Z","size":9706,"stargazers_count":1557,"open_issues_count":7,"forks_count":198,"subscribers_count":69,"default_branch":"master","last_synced_at":"2025-05-02T09:48:54.757Z","etag":null,"topics":["couchpotato","ffmpeg","media","metadata","mkv","mp4","nzbget","qbittorrent","radarr","sabnzbd","sickbeard","sickrage","sonarr","utorrent"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdhiggins.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-02-16T04:27:05.000Z","updated_at":"2025-05-02T08:49:46.000Z","dependencies_parsed_at":"2024-01-02T11:31:24.324Z","dependency_job_id":"b9d4d047-6f55-4889-8f69-f2654f38e07f","html_url":"https://github.com/mdhiggins/sickbeard_mp4_automator","commit_stats":{"total_commits":2380,"total_committers":72,"mean_commits":33.05555555555556,"dds":0.4084033613445378,"last_synced_commit":"d9bdd8d298edcaa5d0d820be3e25bb86717b1766"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdhiggins%2Fsickbeard_mp4_automator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdhiggins%2Fsickbeard_mp4_automator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdhiggins%2Fsickbeard_mp4_automator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdhiggins%2Fsickbeard_mp4_automator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdhiggins","download_url":"https://codeload.github.com/mdhiggins/sickbeard_mp4_automator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254101558,"owners_count":22014908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["couchpotato","ffmpeg","media","metadata","mkv","mp4","nzbget","qbittorrent","radarr","sabnzbd","sickbeard","sickrage","sonarr","utorrent"],"created_at":"2024-08-01T02:01:56.948Z","updated_at":"2025-05-14T08:09:32.275Z","avatar_url":"https://github.com/mdhiggins.png","language":"Python","funding_links":[],"categories":["Python","HarmonyOS","Ripping, Transcoding, Converting","ffmpeg"],"sub_categories":["Windows Manager","Subtitles Automation"],"readme":"SMA Conversion/Tagging Automation Script\n==============\n\n**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.**\n\n![The Matrix](https://user-images.githubusercontent.com/3608298/76170063-e415c300-6154-11ea-88cd-d26653a47cc5.PNG)\n\nWorks on Windows, OSX, and Linux. Despite the name works with much more than just Sickbeard and handles more than MP4s\n\nIntegration\n--------------\n### Media Managers Supported\n- [Sonarr](#sonarr-setup)\n- [Radarr](#radarr-setup)\n- [Sickbeard](#sickbeard-setup)\n- [SickRage](#sickrage-setup)\n\n### Downloaders Supported\n- [NZBGet](#nzbget-setup)\n- [SABNZBD](#sabnzbd-setup)\n- [Deluge Daemon](#deluge-daemon-setup)\n- [uTorrent](#utorrent-setup)\n- [qBittorrent](#qbittorrent-setup)\n\nDependencies\n--------------\n- [Python 3](https://www.python.org/)\n- [FFmpeg](https://ffmpeg.org/)\n- [Python Packages](https://github.com/mdhiggins/sickbeard_mp4_automator/wiki/Dependencies)\n\nDefault Settings\n--------------\n- Container - MP4\n- Video - H264\n- Audio - AAC 2.0 with additional AC3 track when source has \u003e2 channels (ex 5.1)\n- Subtitles - mov_text\n\nDocker\n--------------\nTwo 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\n- https://hub.docker.com/r/mdhiggins/sonarr-sma\n- https://hub.docker.com/r/mdhiggins/radarr-sma\n\nGeneral Configuration\n--------------\n1. Download or compile FFmpeg \n2. Install [requirements/dependencies](#dependencies)\n3. Rename `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)\n4. Set the [configuration options](https://github.com/mdhiggins/sickbeard_mp4_automator/wiki/autoProcess-Settings) to your desired output and include the path of your new FFmpeg / FFprobe binaries\n5. Run [manual.py](#manual-script-usage) and test out a conversion\n6. Configure direct integration using the instructions below\n\nSonarr Setup\n--------------\n1. Set your [Sonarr settings](https://github.com/mdhiggins/sickbeard_mp4_automator/wiki/autoProcess-Settings#sonarr) in autoProcess.ini\n2. Browse to the Settings\u003eDownload Client tab and enable advanced settings [Show].\n3. Setup the postSonarr.py script via Settings \u003e Connect \u003e Connections \u003e + (Add)\n    - `name` - postSonarr\n    - `On Grab` - No\n    - `On Download` \\ `On Import` - Yes\n    - `On Upgrade` - Yes\n    - `On Rename` - No\n    - `On Movie Delete` - No\n    - `On Movie File Delete` - No\n    - `On Health Issue` - No\n    - `Path` - Full path to your python executable\n    - `Arguments` - Full path to `postSonarr.py`\n    - For Sonarr V3 you'll need to make a .sh or .bat file to combine your path to python and script\n4. **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**\n\nRadarr Setup\n--------------\n1. Set your [Radarr settings](https://github.com/mdhiggins/sickbeard_mp4_automator/wiki/autoProcess-Settings#radarr) in autoProcess.ini\n2. Browse to the Settings\u003eDownload Client tab and enable advanced settings [Show].\n3. Setup the postRadarr.py script via Settings \u003e Connect \u003e Connections \u003e + (Add)\n    - `name` - postRadarr\n    - `On Grab` - No\n    - `On Download` \\ `On Import` - Yes\n    - `On Upgrade` - Yes\n    - `On Rename` - No\n    - `On Movie Delete` - No\n    - `On Movie File Delete` - No\n    - `On Health Issue` - No\n    - `Path` - Full path to your python executable\n    - `Arguments` - Full path to `postRadarr.py`\n    - For Radarr V3 you'll need to make a .sh or .bat file to combine your path to python and script\n4. **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**\n\nSickbeard Setup\n--------------\n1. Open Sickbeard's config.ini in Sick Beard installation folder\n    - Set \"extra_scripts\" value in the general section to the full path to \"python postSickbeard.py\" using double backslashes\n        - Example: `C:\\\\Python27\\\\python C:\\\\Scripts\\\\postSickbeard.py`\n        - Make sure this is done while Sick Beard is not running or it will be reverted\n2. Set your [SickBeard settings](https://github.com/mdhiggins/sickbeard_mp4_automator/wiki/autoProcess-Settings#sickbeard) in autoProcess.ini\n\nSickRage Setup\n--------------\n1. 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:\n    - `C:\\\\Python27\\\\python.exe C:\\\\sickbeard_mp4_automator\\\\postSickbeard.py`\n    - `/usr/bin/python /home/user/sickbeard_mp4_automator/postSickbeard.py`\n2. Set the [Sickrage settings](https://github.com/mdhiggins/sickbeard_mp4_automator/wiki/autoProcess-Settings#sickrage) in autoProcess.ini\n\nNZBGet Setup\n--------------\n1. Copy the script NZBGetPostProcess.py to NZBGet's script folder.\n    - Default location is /opt/nzbget/scripts/\n2. Start/Restart NZBGet\n3. Configure NZBGETPOSTPROCESS\n    - Access NZBGet's WebUI\n        - Default `localhost:6789`\n    - Go to `Settings`\n    - Select `NZBGETPOSTPROCESS` option at the bottom of the left hand navigation panel and configure the options\n        - `MP4_FOLDER` - default `~/sickbeard_mp4_automator/` - Location of the script. Use full path with trailing backslash.\n        - `SHOULDCONVERT` - `True`/`False` - Convert file before passing to destination\n        - `SONARR_CAT` - default `sonarr` - category of downloads that will be passed to Sonarr\n        - `SICKBEARD_CAT` - default `sickbeard` - category of downloads that will be passed to Sickbeard\n        - `SICKRAGE_CAT` - default `sickrage` - category of downloads that will be passed to Sickrage\n        - `BYPASS_CAT` - default `bypass` - category of downloads that may be converted but won't be passed on further\n    - Save changes\n    - Reload NZBGet\n4. 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.\n    - In the relevant category set `PostScript` to NZBGetPostProcess.py to ensure SMA is called.\n\n*Not required if using Completed Download Handling with Sonarr/Radarr*\n\nSABNZBD Setup\n--------------\n1. Set your [SABNZBD settings](https://github.com/mdhiggins/sickbeard_mp4_automator/wiki/autoProcess-Settings#sabnzbd) in autoProcess.ini\n2. Point SABNZBD's script directory to the root directory where you have extract the script.\n3. Configure categories. Categories will determine where the download is sent when it is finished\n    - `Settings \u003e Categories`\n    - Configure `name` to match the settings from the `SABNZBD` section of `autoProcess.ini`\n        - Default `sickbeard`\n        - Default `sickrage`\n        - Default `sonarr`\n        - Default `bypass`\n    - Select the SABPostProcess.py script\n    - Save EACH category\n4. 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\n\n*Not required if using Completed Download Handling with Sonarr/Radarr*\n\nDeluge Daemon Setup\n--------------\n1. Create username and password for deluge daemon\n    - Navigate to your deluge configuration folder\n        - `%appdata%\\Roaming\\Deluge` in Windows\n        - `/var/lib/deluge/.config/deluge/` in Linux\n    - Open the `auth` file\n    - Add a username and password in the format `\u003cusername\u003e:\u003cpassword\u003e:\u003clevel\u003e`. Replace \u003cusername\u003e and \u003cpassword\u003e with your choice and level with your desired authentication level. Default level is `10`. Save auth.\n        - Ex: `sampleuser:samplepass:10`\n2. Start/Restart deluged\n    - *deluged* not \u003ci\u003edeluge\u003c/i\u003e\n    - If you're running Deluge on Windows and not setting up the daemon as a service, you can trigger the daemon to run in the background by disabling *Classic Mode* in your Deluge preferences under the *Interface* section\n3. Access the WebUI\n    - Default port is `8112`\n    - Default password is `deluge`\n4. Enabled the `Execute` plugin\n    - Add event for `Torrent Complete`\n    - 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\n5. Set your [Deluge settings](https://github.com/mdhiggins/sickbeard_mp4_automator/wiki/autoProcess-Settings#deluge) in autoProcess.ini\n6. 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\n\n*Not required if using Completed Download Handling with Sonarr/Radarr*\n\nuTorrent Setup\n--------------\n1. Launch uTorrent\n2. Set `Run Program` option\n    - Go to `Options \u003e Preferences \u003e Advanced \u003e Run Program`\n    - Point to `uTorrentPostProcess.py` with command line parameters: `%L %T %D %K %F %I %N` in that exact order.\n3. Set your [uTorrent settings](https://github.com/mdhiggins/sickbeard_mp4_automator/wiki/autoProcess-Settings#utorrent) in autoProcess.ini\n4. 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\n\n*Not required if using Completed Download Handling with Sonarr/Radarr*\n\nqBittorrent Setup\n--------------\n1. Launch qBittorrent\n2. Set `Run Program` option\n    - Go to `Tools \u003e Options \u003e Run external program on torrent completion`\n    - Point to `qBittorrentPostProcess.py` with command line parameters: `\"%L\" \"%T\" \"%R\" \"%F\" \"%N\" \"%I\"` in that exact order.\n3. Set your [qBittorrent settings](https://github.com/mdhiggins/sickbeard_mp4_automator/wiki/autoProcess-Settings#qbittorrent) in autoProcess.ini\n4. 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\n\n*Not required if using Completed Download Handling with Sonarr/Radarr*\n\nPlex Notification\n--------------\nSend 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.\n1. Disable automatic refreshing on your Plex server\n    - `Settings \u003e Server \u003e Library` and disable `Update my library automatically` and `Update my library periodically`.\n3. Set your [Plex settings](https://github.com/mdhiggins/sickbeard_mp4_automator/wiki/autoProcess-Settings#plex) in autoProcess.ini\n\nIf 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.\n\nFound under Plex Server Settings \u003e Network \u003e Advanced\n![image](https://user-images.githubusercontent.com/3608298/52716936-e61b4b80-2f6d-11e9-8537-83ab9321948b.png)\n\nOverride Configuration Path\n--------------\nIf 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\n\nPost Process Scripts\n--------------\n- See https://github.com/mdhiggins/sickbeard_mp4_automator/blob/master/post_process/post_process.md\n\nManual Script Usage\n--------------\nTo run the script manually, simply run the manual.py file and follow the prompts it presents.\nIf you wish to run it via the command line (good for batch operations) follow this format:\n\n```\nHelp output\nmanual.py -h\nusage: manual.py [-h] [-i INPUT] [-a] [-tv TVDBID] [-s SEASON] [-e EPISODE]\n                 [-imdb IMDBID] [-tmdb TMDBID] [-nm] [-nc] [-nd]\n\nManual conversion and tagging script for sickbeard_mp4_automator\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -i INPUT, --input INPUT\n                        The source that will be converted. May be a file or a\n                        directory\n  --config              Specify an alternate configuration file location\n  -a, --auto            Enable auto mode, the script will not prompt you for\n                        any further input, good for batch files. It will guess\n                        the metadata using guessit\n  -tmdb TMDBID, --tmdbid TMDBID\n                        Specify the TMDB ID for media\n  -tvdb TVDBID, --tvdbid TMBDID\n                        Specify the TVDB ID for media\n  -imdb IMDBID, --imdbid IMDBID\n                        Specify the IMDB ID for media\n  -s SEASON, --season SEASON\n                        Specifiy the season number\n  -e EPISODE, --episode EPISODE\n                        Specify the episode number\n  -nm, --nomove         Overrides and disables the custom moving of file\n                        options that come from output_dir and move-to\n  -m, --moveto          Override move-to value setting in autoProcess.ini\n                        changing the final destination of the file\n  -nc, --nocopy         Overrides and disables the custom copying of file\n                        options that come from output_dir and move-to\n  -nt, --notag          Overrides and disables tagging when using the\n                        automated option\n  -to, --tagonly        Only tag without conversion\n  -nd, --nodelete       Overrides and disables deleting of original files\n  -pr, --preserverelative\n                        Preserves relative directories when processing\n                        multiple files using the copy-to or move-to\n                        functionality\n  -pse, --processsameextensions   \n                        Overrides process-same-extensions setting in \n                        autoProcess.ini enabling the reprocessing of files\n  -fc, --forceconvert   Overrides force-convert setting in autoProcess.ini and \n                        also enables process-same-extenions if true forcing the conversion of files\n  -oo, --optionsonly    Display generated conversion options only, do not perform conversion\n  -cl, --codeclist      Print a list of supported codecs and their paired FFMPEG encoders\n  -pa, --processedarchive\n                        Specify a processed list/archive so already processed files are skipped\n```\n\nExamples\n```\nMovies (using IMDB ID):\nmanual.py -i mp4path -imdb imdbid\nExample: manual.py -i \"C:\\The Matrix.mkv\" -imdb tt0133093\n\nMovies (using TMDB ID)\nmanual.py -i mp4path -tmdb tmdbid\nExample: manual.py -i \"C:\\The Matrix.mkv\" -tmdb 603\n\nTV\nmanual.py -i mp4path -tvdb tmbdid -s season -e episode\nExample: manual.py -i \"C:\\Futurama S03E10.mkv\" -tvdb 73871‎ -s 3 -e 10\n\nAuto Single File (will gather movie ID or TV show ID / season / spisode from the file name if possible)\nmanual.py -i mp4path -a\nExample: manual.py -i \"C:\\Futurama S03E10.mkv\" -a\n\nDirectory (you will be prompted at each file for the type of file and ID)\nmanual.py -i directory_path\nExample: manual.py -i C:\\Movies\n\nAutomated Directory (The script will attempt to figure out appropriate tagging based on file name)\nmanual.py -i directory_path -a\nExample: manual.py -i C:\\Movies -a\n\nProcess a directory but manually specific TVDB ID (Good for shows that don't correctly match using the guess)\nmanual.py -i directory -a -tvdb tvdbid\nExample: manual.py -i C:\\TV\\Futurama\\ -a -tvdb 615\n```\nYou 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.\nYou 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.\nThe 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.\n\nExternal Cover Art\n--------------\nTo 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`\n\nImport External Subtitles\n--------------\nTo 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.\n\nNaming example:\n```\ninput mkv - The.Matrix.1999.mkv\nsubtitle srt - The.Matrix.1999.eng.srt\n```\n\nCredits\n--------------\nThis project makes use of, integrates with, or was inspired by the following projects:\n- http://www.ffmpeg.org/\n- http://www.python.org/\n- http://www.sickbeard.com/\n- http://sabnzbd.org/\n- https://nzbget.net/\n- https://www.deluge-torrent.org/\n- https://www.qbittorrent.org/\n- http://github.com/senko/python-video-converter\n- https://github.com/celiao/tmdbsimple\n- https://github.com/quodlibet/mutagen\n- http://github.com/danielgtaylor/qtfaststart\n- http://github.com/wackou/guessit\n- http://github.com/Diaoul/subliminal\n- http://sonarr.tv/\n- http://radarr.video/\n- https://github.com/ratoaq2/cleanit\n\n## Enjoy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdhiggins%2Fsickbeard_mp4_automator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdhiggins%2Fsickbeard_mp4_automator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdhiggins%2Fsickbeard_mp4_automator/lists"}