Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Support Custom Formats #2

Open
Protektor-Desura opened this issue Aug 3, 2022 · 6 comments
Open

Enhancement: Support Custom Formats #2

Protektor-Desura opened this issue Aug 3, 2022 · 6 comments

Comments

@Protektor-Desura
Copy link

I would like to see these options supported:

Lists (examples, IMDB top 250, Criterion Collection, etc)
Custom Formats (supported from Radarr? Audio codecs, Video codecs, etc for ranking/preferences to download)
Release Profiles (supported from Sonarr? Audio codecs, Video codecs, etc for ranking/preferences to download)
Quality Definitions (STV, DVD, WEB, Bluray, etc, bitrates and file sizes)
Connections (connect with Jellyfin to update it, post processing scripts, etc)
Metadata (create metadata files for video files)

Basically every single option to setup the *arrs so I can duplicate and save my setup since I have my stuff setup highly configured.

@PierreMesure
Copy link
Contributor

Hi, it’s hard to tell you for sure if those are supported as I haven’t tried but there’s a good chance they will.

The script at the core of Flemmarr takes the keys of your config file and send queries with the same name to the API, including the payload that you included under these keys.

So I haven’t developed support for any specific type of data. I’ve just made it able to send any data and you need to provide it in the right way for it to be understood by your -arr apps.

I hope that was clear. Are you familiar with the API of your -arr apps? Do you think you could have a look at how to create all these things with the API and once you’ve succeeded, write it as YAML in your config file and see if that works?

@Protektor-Desura
Copy link
Author

Protektor-Desura commented Aug 4, 2022

I'm not sure I understand what you mean. I mean here is the json for two custom formats in Radarr.

This is to identify mono sound.

{
  "name": "1.0 Mono",
  "includeCustomFormatWhenRenaming": false,
  "specifications": [
    {
      "name": "Mono",
      "implementation": "ReleaseTitleSpecification",
      "negate": false,
      "required": true,
      "fields": {
        "value": "[^0-9]1\\.0|\\bMono\\b|\\[PCM \\]"
      }
    },
    {
      "name": "Not Stereo",
      "implementation": "ReleaseTitleSpecification",
      "negate": true,
      "required": true,
      "fields": {
        "value": "(?<!repac)[^0-9]2\\.0|\\bStereo\\b"
      }
    },
    {
      "name": "Not 3.0ch",
      "implementation": "ReleaseTitleSpecification",
      "negate": true,
      "required": true,
      "fields": {
        "value": "[^0-9]3\\.0"
      }
    },
    {
      "name": "Not 4.0ch",
      "implementation": "ReleaseTitleSpecification",
      "negate": true,
      "required": true,
      "fields": {
        "value": "[^0-9]4\\.0"
      }
    },
    {
      "name": "Not High Channel Count",
      "implementation": "ReleaseTitleSpecification",
      "negate": true,
      "required": true,
      "fields": {
        "value": "[^0-9][5-9]\\.[0-1]"
      }
    }
  ]
}

Here is one to identify H.265/HEVC

{
  "name": "x265/HEVC",
  "includeCustomFormatWhenRenaming": false,
  "specifications": [
    {
      "name": "x265/HEVC",
      "implementation": "ReleaseTitleSpecification",
      "negate": false,
      "required": true,
      "fields": {
        "value": "[xh][ .]?265|\\b(?i)hevc*(?-i)(\\b)"
      }
    }
  ]
}

@Protektor-Desura
Copy link
Author

You might want to look here for all the settings that people are customizing things to be recognized.

https://trash-guides.info/Radarr/Radarr-collection-of-custom-formats/

@Protektor-Desura
Copy link
Author

Here is the section of the API to support these.

https://radarr.video/docs/api/#/CustomFormat

@PierreMesure
Copy link
Contributor

I’m saying: it should already work to use Flemmarr to add this. Why don’t you try to do it and add an example to the documentation when you’ve succeeded? 😊

@AurimasNav
Copy link

AurimasNav commented May 29, 2023

@Protektor-Desura

Given the H.265/HEVC example custom format, these are the steps to figure out how to config it in flemmarr:

  1. Open sonarr
  2. Open browser developer tools (F12 in edge) - go to network tab dev tools - network - 1
  3. In sonarr navigate to custom formats, click to add new, import your json, click import and click save
  4. A new request should be visible in network tab of browser dev tools (probably named 'customformats')
  5. Inspect Headers, underlined path element after ../api/v3/ should tell you which yaml section this config goes under in flemmarr headers request url - 2
  6. Inspect payload, copy the payload root object copy payload object - 3
  7. Paste the payload object into json to yaml converter like this one: https://json2yaml.com//
  8. Copy the resulting yaml (except the first line '---' into your sonarr config under the key identified in step 5

the result should look something like this:

sonarr:
  server:
    address: sonarr
    port: 80
  customformat:
    - includeCustomFormatWhenRenaming: false
      name: x265/HEVC
      specifications:
      - implementation: ReleaseTitleSpecification
        implementationName: Release Title
        infoLink: https://wiki.servarr.com/sonarr/settings#custom-formats-2
        negate: false
        required: true
        fields:
        - order: 0
          name: value
          label: Regular Expression
          helpText: Custom Format RegEx is Case Insensitive
          type: textbox
          advanced: false
          privacy: normal
          value: "[xh][ .]?265|\\b(?i)hevc*(?-i)(\\b)"
        name: x265/HEVC
        id: 1

Note that there might be multiple custom formats, therefore elements of customformat ar mebers of list (hence dash before includeCustomFormatWhenRenaming: false even if it was not in the original object we copied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants