Automatic download of subtitles from addic7ed.com as well as a script for Sonarr for full automation. Made to run on Windows only.
Can be configured to check for subtitles every X hours, so you get them even if they're not ready when you got the episode.
Unzip the release zip into a folder (Downloads can be found here). Run SonarrScript.exe once to generate config.xml See more about editing / configuring config.xml at the bottom of this page.
You can drag folders or media files on top of SonarrScript.exe to run it for those files/folders (for example of existing files you have that are missing subtitles). Choosing SonarrScript.exe as Open With on a media file will also work.
#Configuring Sonarr In Sonarr, go to Settings -> Connect Click the big plus (+) to add a new Connection. Give it a name (for example addic2subs), and set it to run On Download and On Upgrade (not On Grab or On Rename). In Path, you locate SonarrScript.exe Leave Arguments empty.
#Configuring Task Scheduler
We want to check every X hours if the new subtitles are up yet. To do that, we use a feature in Windows called Task Scheduler to run SonarrScript.exe every X hours. So first, open Task Scheduler by pressing Windows Button + R to open the Run window. Enter the following text: control schedtasks
and hit enter.
In the Task Scheduler, right click Task Scheduler Library
and click Create Task
.
Give it a name, make sure it runs under a user that has access to run SonarrScript.exe and modify files at your media location. I also recommend setting it to Run whether user is logged on or not
.
Under triggers, create a new trigger, set it to daily and start at 12:XX:XX AM. Please choose a random minute(so everyone isn't bombarding addic7ed.com's website at the same time). Check Repeat task every
and choose how often you want it to run.
Next, we add a new Action. Go to the Actions
Tab and press New...
.
Action should be Start a program
, and the Program/script should be the path to SonarrScript.exe
That's it, now your all set!
#Configuration (config.xml) Open config.xml in your favorite XML editor. After first run of the program, the file isn't very long. But after it has processed video files, the file will become VERY long (containing all shows from addic7ed.com). All the tags described below will be towards the bottom of the file.
<UnknownLanguage>en</UnknownLanguage>
If there is no language indication on a current subtitle file (just VideoName.srt), it will assume the subtitle is in english.
<MediaFileExtensions>
<string>.avi</string>
<string>.mp4</string>
<string>.mkv</string>
</MediaFileExtensions>
Only look for subtitles for files with these extension.
<AppendLanguageCode>true</AppendLanguageCode>
Add language code to the end of the subtitle (VideoName.en.srt). Most programs like Plex, Emby etc. will understand this and show the subtitle language in the interface.
<MaxTries>10</MaxTries>
How many times should we look for a subtitle? For example, if you set it to check every 4th hour, MaxTries of 10 will make it check for 40 hours (10 attempts with 4 hours between each time). Please do not set this to a very high number, out of respect to addic7ed.com. If your subtitle is not available after a few days, it's likely that there will not be any subtitles for the release you've grabbed, and then there's no need to keep sending requests to their website to check for new.
<Language>
<DisplayName>English</DisplayName>
<PrimaryValue>en</PrimaryValue>
<Values>
<string>en</string>
<string>eng</string>
<string>en-US</string>
<string>en-GB</string>
<string>English</string>
<string>English (US)</string>
<string>English (UK)</string>
</Values>
<LookForSubtitles>true</LookForSubtitles>
</Language>
In LanguageCollection, you see a list of predefined languages. If yours is not already here, you can add it yourself. I will describe some of the values below:
<DisplayName>English</DisplayName>
Not really used, but if I ever make a GUI, this is the name that will be showed.
<PrimaryValue>en</PrimaryValue>
The value that will be appended to the subtitle filename when a subtitle is downloaded for this language. For example VideoName.en.srt (only if AppendLanguageCode is enabled).
<Values>
<string>en</string>
<string>eng</string>
<string>en-US</string>
<string>en-GB</string>
<string>English</string>
<string>English (US)</string>
<string>English (UK)</string>
</Values>
Possible ways the language can be detected. For example VideoName.eng.srt will be detected as English because it is listed here. So if you've configured it to download English subtitles, and a subtitle with one of the above strings appended in the filename, it will be marked as done.
<LookForSubtitles>true</LookForSubtitles>
Pretty much self explanatory. Should the program look for subtitles in this language or not?
Further down, we have ReleaseGroupRelations. These are used to group release groups together as always having matching subtitles. Take an example:
<RlsGrpRelation>
<Groups>
<string>LOL</string>
<string>SYS</string>
<string>DIMENSION</string>
</Groups>
</RlsGrpRelation>
Here we tell the program that if we have a file from DIMENSION, then it's ok to download subtitles for LOL and SYS aswell, as the subtitles always match (synced).