From cf91a35999c52f906eebbc0996fb96d0d556233d Mon Sep 17 00:00:00 2001 From: Ilya Pavlov Date: Mon, 18 Apr 2022 11:42:08 +0300 Subject: [PATCH] bitru: add series search (#13175) --- src/Jackett.Common/Definitions/bitru.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/Jackett.Common/Definitions/bitru.yml b/src/Jackett.Common/Definitions/bitru.yml index 5e97aa4e6..f642a2652 100644 --- a/src/Jackett.Common/Definitions/bitru.yml +++ b/src/Jackett.Common/Definitions/bitru.yml @@ -25,7 +25,7 @@ caps: modes: search: [q] - tv-search: [q] + tv-search: [q, season, ep] movie-search: [q] music-search: [q] book-search: [q] @@ -59,6 +59,9 @@ search: s: "{{ .Keywords }}" sort: "{{ re_replace .Config.sort \"_\" \"\" }}" $raw: "{{ if .Config.adverts }}{{ else }}&rek=no{{ end}}" + keywordsfilters: + - name: re_replace # S01 or S01E01 to 1 сезон + args: ["(?i)\\bS0*(\\d+)(?:E0*(\\d+))?\\b", "$1 сезон"] rows: selector: table.browse-list > tbody > tr @@ -76,15 +79,21 @@ search: - name: replace args: ["селезень", "selezen"] - name: re_replace - args: ["(\\([А-Яа-яЁё\\W]+\\))|(^[А-Яа-яЁё\\W\\d]+\\/ )|([а-яА-ЯЁё \\-]+,+)|([а-яА-ЯЁё]+)", "{{ if .Config.striprussian }}{{ else }}$1$2$3$4{{ end }}"] + args: ["(?:(\\d+-*\\d*)\\s+[Сс]езоны?:?)\\s+\\((\\d+-*\\d*).*[?\\d]+\\)(.*)(\\((?:[12][0-9]{3}-?){1,}\\))(.*)", "$3 - S$1E$2 - $4 $5"] - name: re_replace - args: ["[\\:\\-\\/\\|\\[\\]]", " "] + args: ["\\((\\d+-*\\d*).*[?\\d]+\\)(.*)(\\((?:[12][0-9]{3}-?){1,}\\))(.*)", "$2 - E$1 - $3 $4"] + - name: re_replace + args: ["(\\([А-Яа-яЁё\\W]+\\))|(^[А-Яа-яЁё\\W\\d]+\\/ )|([а-яА-ЯЁё \\-]+,+)|([а-яА-ЯЁё]+)", "{{ if .Config.striprussian }}{{ else }}$0{{ end }}"] + - name: re_replace + args: ["[!?.,:|\\[\\]\\/]", " "] + - name: re_replace + args: ["^\\s+-\\s+", " "] - name: append args: "{{ if .Config.addrussian }} - RUSSIAN{{ else }}{{ end }}" - name: replace - args: [" Rip", "Rip"] + args: ["-Rip", "Rip"] - name: replace - args: ["WEB DL", "WEBDL"] + args: ["WEB-DL", "WEBDL"] - name: replace args: ["WEBDLRip", "WEBDL"] - name: replace