Custom Formats to filter out rar files in Radarr and Sonarr

75 0

This tutorial will show you how to use regex in a custom format to filter out rar files in Radarr and Sonarr. There are many options for dealing with unpacking rar files and moving them to where you wish even. If you have plenty of storage space then it is not an issue to extract and place it in another location and continue to seed the original rar files. But if storage is short then you might just want to avoid the rar files all together. To me storage is always an issue. It is like money. You can make a small amount of money and always be struggling and then when you start making more you feel like oh there is enough money now. Eventually you find places to spend it and once again you are feeling stretched. It almost does not matter how much storage you have, there is always something that can fill it up.

Update 09/19/2024

I updated this with some changes under the section update below, but you still should read the whole article.

The basics

We are going to be searching for specific words in the title of a torrent to either accept or deny. You will need to do some research into which uploads have rar files and which don’t. You want to accept the ones that do not and reject the ones that do. For example, if I know MeGusta does not have rar files then I want to add it to what I will accept. I will also add some terms that further restricts what I want like 265 or 264. You could also add 1080p or 2160p for example, but this is generally done in the quality section of the arr apps. Or even if you are using Ombi or Overseer as well.

Regex

First let’s play around with Regex a little so I can explain how it is doing this. Open https://regex101.com/ and copy and paste this regex below into the top section labeled Regular Expression (Yep Regex is short for Regular Expression).

^(?=.*MeGusta|.*265|.*264|.*x0r)(?:(?!ETHEL|EDITH|SuccessfulCrab).)*$

Just a little explanation about this regex. This section: “(?=.*MeGusta|.*265|.*264|.*x0r)”, is called a Positive Lookahead. The “|” means or, so “.*MeGusta|.*265” means you will accept either MeGusta or 265 in the title and this is case sensitive. The “.” matches any character (except for line terminators). The “*” matches the previous token between zero and unlimited times, as many times as possible, giving back as needed. “MeGusta” matches the characters literally.

This section: “(?:(?!ETHEL|EDITH).)*$” is a Negative Lookahead and means if it contains ETHEL or EDITH we do not want this one. The “^” means it is the beginning of the line and “$” means it is the end.

Ok let’s copy and paste this line in the section labeled test string. This is a sample torrent name:

Land of Women S01E06 1080p WEB H264-SuccessfulCrab

You will see that this test string does not match the regex, so in this case it would not download it because it is listed in the Negative Lookahead that we do not want that in the title.

Now let’s modify the regex and take out the word SuccessfulCrab like this (note that the test string is now highlighted blue, which indicates it matches):

Custom Formats

In the settings of Radarr and Sonarr you will find a section titled “Custom Formats”. Click on that and you will see a box with a plus sign. Click on it and choose Release Title

Give it a name, I went with Must Contain and enter the regex you came up with and check the required box. Later, if you discover new uploads with rar files then simply come back and exclude them here by adding |name at the end before a parenthesis.

 

Profiles

Now go to your profiles (do this for each one) and choose the name of the custom format and give it a score. I did 100 and then chose min score of 100.

Update

I decided to modify this because as it is, it treats 264 and 265 the same. I prefer 265 and others may prefer 264. I separated the positive look ahead by the 264 and 265 and left the negative lookups the same for both. So now there are 2 custom formats like this:

Then I went to each of the profiles and added both custom formats and assigned one a larger number than the other. This tells it to first download a 265, but if there is not one available, download the 264.

My json

Here is my json for each if you want to just copy and import/paste into your own custom format, give it title etc.

Sonarr 265

{
  "name": "Must Contain 265",
  "includeCustomFormatWhenRenaming": false,
  "specifications": [
    {
      "name": "Must Contain 265",
      "implementation": "ReleaseTitleSpecification",
      "negate": false,
      "required": false,
      "fields": {
        "value": "^(?=.*MeGusta|.*265|.*HEVC)(?:(?!ETHEL|EDITH|SYNCOPY|GloriousMongoose|SKYFiRE|TABULARiA|NHTFS|ELEANOR|DiMEPiECE|SuccessfulCrab|DARKFLiX|DARKSPORT|CBFM|DEADPOOL|AMB3R|DiRT|FERENGI|ROPATA|BAE|FREQUENCY|ORENJI|FQM|BETTY|POPPYCOCK|SUBSCRIBE|DELORES|CODSWALLOP|LightSaber|HiggsBoson|KIDENGEE|KOGi).)*$"
      }
    }
  ]
}

Sonarr 264

{
  "name": "Must Contain 264",
  "includeCustomFormatWhenRenaming": false,
  "specifications": [
    {
      "name": "Must Contain 264",
      "implementation": "ReleaseTitleSpecification",
      "negate": false,
      "required": false,
      "fields": {
        "value": "^(?=.*264)(?:(?!ETHEL|EDITH|SYNCOPY|GloriousMongoose|SKYFiRE|TABULARiA|NHTFS|ELEANOR|DiMEPiECE|SuccessfulCrab|DARKFLiX|DARKSPORT|CBFM|DEADPOOL|AMB3R|DiRT|FERENGI|ROPATA|BAE|FREQUENCY|ORENJI|FQM|BETTY|POPPYCOCK|SUBSCRIBE|DELORES|CODSWALLOP|LightSaber|HiggsBoson|KIDENGEE|KOGi).)*$"
      }
    }
  ]
}

Radarr

{
  "name": "Must Contain",
  "includeCustomFormatWhenRenaming": false,
  "specifications": [
    {
      "name": "Must Contain",
      "implementation": "ReleaseTitleSpecification",
      "negate": false,
      "required": true,
      "fields": {
        "value": "^(?=.*MeGusta|.*265|.*x0r|.*HEVC-d3g|.*BiTOR|.*TRiToN|.*SiQ|.*PoF|.*LEGiON|.*playBD|.*EPSiLON|.*GeneMige|.*WiKi|.*PEBBLES104|.*DON|.*BeiTai|.*PRodJi|.*Nb8|.*KRaLiMaRKo|.*KUCHU|.*ShiNobi|.*FGT|.*FLUX|.*SbR|.*HDT|.*PiR8|.*PieR8|.*NoGrp|.*RMTeam|.*TWA|.*FraMeSToR|.*SMURF|.*TRF|.*tijuco|.*VooDoo|.*SADPANDA|.*PiRaTes|.*SHHH|.*D-ZON3|.*EVO|.*Asimov|.*LAMA)(?:(?!ETHEL|EDITH|iNTEGRUM|DakotaJohnsonMarryMe).)*$"
      }
    }
  ]
}

Final Thoughts

Your sonarr and radarr custom formats can and probably will be different so make sure to test your regex using some test strings for actual title names. I previously used the release profile in profiles but it seemed to not work correctly all the time and seemed to be getting less reliable. So, I started messing around with the custom formats to see if I could get better matches that way.  It seems to be working most excellently.

Find more at https://notposted.com

Total 0 Votes
0

Tell us how can we improve this post?

+ = Verify Human or Spambot ?

About The Author

Coolest hedgehog in town!

No Comments on "Custom Formats to filter out rar files in Radarr and Sonarr"

Leave a Comment

Your email address will not be published. Required fields are marked *