From 584345480b11bdfb52717103e5dd82c30fb2e97b Mon Sep 17 00:00:00 2001 From: ilike2burnthing <59480337+ilike2burnthing@users.noreply.github.com> Date: Sat, 18 Dec 2021 04:52:15 +0000 Subject: [PATCH] assorted: optionally add russian tag to titles. resolves #12710 (#12713) --- src/Jackett.Common/Definitions/noname-club.yml | 13 +++++++++++++ src/Jackett.Common/Definitions/noname-clubl.yml | 13 +++++++++++++ src/Jackett.Common/Definitions/rutor.yml | 13 +++++++++++++ 3 files changed, 39 insertions(+) diff --git a/src/Jackett.Common/Definitions/noname-club.yml b/src/Jackett.Common/Definitions/noname-club.yml index a9171ec9a..1e84e1ea2 100644 --- a/src/Jackett.Common/Definitions/noname-club.yml +++ b/src/Jackett.Common/Definitions/noname-club.yml @@ -17,6 +17,10 @@ settings: type: checkbox label: Strip Russian Letters default: true + - name: addrussian + type: checkbox + label: Add RUSSIAN to end of all titles to improve language detection by Sonarr and Radarr. Will cause English-only results to be misidentified. + default: false - name: sort type: select label: Sort requested from site @@ -797,6 +801,11 @@ search: filters: - name: querystring args: f + title_is_rus: + selector: a[href^="viewtopic.php?t="] > b + filters: + - name: re_replace + args: ["[^А-Яа-яЁё]+", ""] title: selector: a[href^="viewtopic.php?t="] > b filters: @@ -818,6 +827,10 @@ search: args: ["WEBDLRip", "WEBDL"] - name: replace args: ["HDTVRip", "HDTV"] + - name: append + args: "{{ if .Result.title_is_rus }} - RUSSIAN{{ else }}{{ end }}" + - name: re_replace + args: ["(.+?) - RUSSIAN", "{{ if .Config.addrussian }}$1 - RUSSIAN{{ else }}$1{{ end }}"] details: selector: a[href^="viewtopic.php?t="] attribute: href diff --git a/src/Jackett.Common/Definitions/noname-clubl.yml b/src/Jackett.Common/Definitions/noname-clubl.yml index 7f20a9aca..9849f9364 100644 --- a/src/Jackett.Common/Definitions/noname-clubl.yml +++ b/src/Jackett.Common/Definitions/noname-clubl.yml @@ -23,6 +23,10 @@ settings: type: checkbox label: Strip Russian Letters default: true + - name: addrussian + type: checkbox + label: Add RUSSIAN to end of all titles to improve language detection by Sonarr and Radarr. Will cause English-only results to be misidentified. + default: false - name: sort type: select label: Sort requested from site @@ -822,6 +826,11 @@ search: filters: - name: querystring args: f + title_is_rus: + selector: a[href^="viewtopic.php?t="] > b + filters: + - name: re_replace + args: ["[^А-Яа-яЁё]+", ""] title: selector: a[href^="viewtopic.php?t="] > b filters: @@ -843,6 +852,10 @@ search: args: ["WEBDLRip", "WEBDL"] - name: replace args: ["HDTVRip", "HDTV"] + - name: append + args: "{{ if .Result.title_is_rus }} - RUSSIAN{{ else }}{{ end }}" + - name: re_replace + args: ["(.+?) - RUSSIAN", "{{ if .Config.addrussian }}$1 - RUSSIAN{{ else }}$1{{ end }}"] details: selector: a[href^="viewtopic.php?t="] attribute: href diff --git a/src/Jackett.Common/Definitions/rutor.yml b/src/Jackett.Common/Definitions/rutor.yml index 2b6839b85..862732d42 100644 --- a/src/Jackett.Common/Definitions/rutor.yml +++ b/src/Jackett.Common/Definitions/rutor.yml @@ -41,6 +41,10 @@ caps: music-search: [q] settings: + - name: addrussian + type: checkbox + label: Add RUSSIAN to end of all titles to improve language detection by Sonarr and Radarr. Will cause English-only results to be misidentified. + default: false - name: info type: info label: A note about RuTor @@ -70,6 +74,11 @@ search: fields: category: text: 3 + title_is_rus: + selector: td:nth-of-type(2) a[href^="/torrent/"] + filters: + - name: re_replace + args: ["[^А-Яа-яЁё]+", ""] title: selector: td:nth-of-type(2) a[href^="/torrent/"] filters: @@ -79,6 +88,10 @@ search: args: ["E -", "E01-99 -"] - name: replace args: ["Кураж-Бамбей", "kurazh"] + - name: append + args: "{{ if .Result.title_is_rus }} - RUSSIAN{{ else }}{{ end }}" + - name: re_replace + args: ["(.+?) - RUSSIAN", "{{ if .Config.addrussian }}$1 - RUSSIAN{{ else }}$1{{ end }}"] details: selector: td:nth-of-type(2) a[href^="/torrent/"] attribute: href