From aae44fd2d521d63be1e7a91779a7733f016d3311 Mon Sep 17 00:00:00 2001 From: ilike2burnthing <59480337+ilike2burnthing@users.noreply.github.com> Date: Sun, 17 Jul 2022 17:18:41 +0100 Subject: [PATCH] yggtorrent: setting to extend anime compat to 4 digits. resolves #13370 (#13372) --- src/Jackett.Common/Definitions/yggcookie.yml | 14 ++++++++++---- src/Jackett.Common/Definitions/yggtorrent.yml | 14 ++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/Jackett.Common/Definitions/yggcookie.yml b/src/Jackett.Common/Definitions/yggcookie.yml index 5b9ea456c..6cdc9b6eb 100644 --- a/src/Jackett.Common/Definitions/yggcookie.yml +++ b/src/Jackett.Common/Definitions/yggcookie.yml @@ -163,6 +163,10 @@ settings: type: checkbox label: Enhance sonarr compatibility with anime by renaming episode (xxx to exxx). Works only if episode is at the end of the query. Can disturb movies search. (back to the future 3 -> back to the future e3) default: false + - name: enhancedAnime4 + type: checkbox + label: Extend the sonarr compatibility with anime up to 4 digits. This WILL break all searches and result titles which contain years. + default: false - name: sort type: select label: Sort requested from site @@ -207,6 +211,8 @@ search: args: ["(?i)(.*)s([1-9])$", "$1 S0$2"] - name: re_replace # Full season S >= 10 args: ["(?i)(.*)s([1-9][0-9])$", "$1 S$2"] + - name: re_replace # episode number at the end "1234" to "E1234" + args: ["(.*)(\\.|\\s|\\-)(\\d{4})(\\.|\\s|\\-*)(.*)", "{{ if .Config.enhancedAnime4 }}$1 E$3 $5{{ else }}$1$2$3$4$5{{ end }}"] - name: re_replace # episode number at the end "123" to "E123" args: ["(.*)(\\.|\\s|\\-)(\\d{2,3})(\\.|\\s|\\-*)(.*)", "{{ if .Config.enhancedAnime }}$1 E$3 $5{{ else }}$1$2$3$4$5{{ end }}"] # END ANIME HACK @@ -291,15 +297,15 @@ search: args: ["(?i)[\\.\\s\\[\\-]subfrench[\\.\\s\\]\\-]", ".ENGLISH."] title_phase3: text: "{{ if .Config.vostfr }}{{ .Result.title_vostfr }}{{ else }}{{ .Result.title_phase2 }}{{ end }}" - title_anime: + title: text: "{{ .Result.title_phase3 }}" filters: # Sonarr need E in front of 3 digit number or else it thinks it is episode # S01E10 for number 110 for example ==> enhancedAnime + - name: re_replace # extend to 4 digits + args: ["(.*)(\\.|\\s|\\-)(\\d{4})(\\.|\\s|\\-)(.*)", "{{ if .Config.enhancedAnime4 }}$1 E$3 $5{{ else }}$1$2$3$4$5{{ end }}"] - name: re_replace - args: ["(.*)(\\.|\\s|\\-)(\\d{2,3})(\\.|\\s|\\-)(.*)", "$1 E$3 $5"] - title: - text: "{{ if .Config.enhancedAnime }}{{ .Result.title_anime }}{{ else }}{{ .Result.title_phase3 }}{{ end }}" + args: ["(.*)(\\.|\\s|\\-)(\\d{2,3})(\\.|\\s|\\-)(.*)", "{{ if .Config.enhancedAnime }}$1 E$3 $5{{ else }}$1$2$3$4$5{{ end }}"] details: selector: td:nth-child(2) > a attribute: href diff --git a/src/Jackett.Common/Definitions/yggtorrent.yml b/src/Jackett.Common/Definitions/yggtorrent.yml index 5b765e484..b952d1ca1 100644 --- a/src/Jackett.Common/Definitions/yggtorrent.yml +++ b/src/Jackett.Common/Definitions/yggtorrent.yml @@ -155,6 +155,10 @@ settings: type: checkbox label: Enhance sonarr compatibility with anime by renaming episode (xxx to exxx). Works only if episode is at the end of the query. Can disturb movies search. (back to the future 3 -> back to the future e3) default: false + - name: enhancedAnime4 + type: checkbox + label: Extend the sonarr compatibility with anime up to 4 digits. This WILL break all searches and result titles which contain years. + default: false - name: sort type: select label: Sort requested from site @@ -217,6 +221,8 @@ search: args: ["(?i)(.*)s([1-9])$", "$1 S0$2"] - name: re_replace # Full season S >= 10 args: ["(?i)(.*)s([1-9][0-9])$", "$1 S$2"] + - name: re_replace # episode number at the end "1234" to "E1234" + args: ["(.*)(\\.|\\s|\\-)(\\d{4})(\\.|\\s|\\-*)(.*)", "{{ if .Config.enhancedAnime4 }}$1 E$3 $5{{ else }}$1$2$3$4$5{{ end }}"] - name: re_replace # episode number at the end "123" to "E123" args: ["(.*)(\\.|\\s|\\-)(\\d{2,3})(\\.|\\s|\\-*)(.*)", "{{ if .Config.enhancedAnime }}$1 E$3 $5{{ else }}$1$2$3$4$5{{ end }}"] # END ANIME HACK @@ -298,15 +304,15 @@ search: args: ["(?i)[\\.\\s\\[\\-]subfrench[\\.\\s\\]\\-]", ".ENGLISH."] title_phase3: text: "{{ if .Config.vostfr }}{{ .Result.title_vostfr }}{{ else }}{{ .Result.title_phase2 }}{{ end }}" - title_anime: + title: text: "{{ .Result.title_phase3 }}" filters: # Sonarr need E in front of 3 digit number or else it thinks it is episode # S01E10 for number 110 for example ==> enhancedAnime + - name: re_replace # extend to 4 digits + args: ["(.*)(\\.|\\s|\\-)(\\d{4})(\\.|\\s|\\-)(.*)", "{{ if .Config.enhancedAnime4 }}$1 E$3 $5{{ else }}$1$2$3$4$5{{ end }}"] - name: re_replace - args: ["(.*)(\\.|\\s|\\-)(\\d{2,3})(\\.|\\s|\\-)(.*)", "$1 E$3 $5"] - title: - text: "{{ if .Config.enhancedAnime }}{{ .Result.title_anime }}{{ else }}{{ .Result.title_phase3 }}{{ end }}" + args: ["(.*)(\\.|\\s|\\-)(\\d{2,3})(\\.|\\s|\\-)(.*)", "{{ if .Config.enhancedAnime }}$1 E$3 $5{{ else }}$1$2$3$4$5{{ end }}"] details: selector: td:nth-child(2) > a attribute: href