From 01b30b07432feed2909e4cc57bb92a06dd4373c5 Mon Sep 17 00:00:00 2001 From: Khogniak Date: Tue, 22 Aug 2017 17:31:13 +0200 Subject: [PATCH 1/3] Added option to normalize release name --- src/Jackett/Definitions/yggtorrent.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/Jackett/Definitions/yggtorrent.yml b/src/Jackett/Definitions/yggtorrent.yml index 7387e23d2..826951159 100755 --- a/src/Jackett/Definitions/yggtorrent.yml +++ b/src/Jackett/Definitions/yggtorrent.yml @@ -43,6 +43,10 @@ - name: password type: password label: Password + - name: filter_title + type: checkbox + label: Try to normalize releases names by moving year after the title + default: false login: path: "/user/login" method: post @@ -93,8 +97,24 @@ args: [ " an", " year"] - name: append args: " ago" - title: + title_normal: selector: "a.torrent-name" + title_filtered: + selector: "a.torrent-name" + filters: + - name: tolower + - name: re_replace + args: ["^(?:(.+?)((?:[\\.\\-\\s_\\[]+(?:imax|(?:dvd|bd|tv)(?:rip|scr)|bluray(?:\\-?rip)?|720\\s*p?|1080\\s*p?|vof?|vost(?:fr)?|multi|vf(?:f|q)?[1-3]?[1-3]?|(?:true)?french|eng?)[\\.\\-\\s_\\]]*)*)([\\(\\[]?(?:20|1[7-9])\\d{2}[\\)\\]]?)(.*)$|(.*))$", "$1 $3 $2 $4 $5"] + - name: replace + args: [".", " "] + - name: trim + - name: re_replace + args: ["\\s(mkv|avi|divx|xvid|mp4)$", ""] + - name: re_replace + args: ["(\\s{2,5})", " "] + - name: trim + title: + text: "{{if .Config.filter_title }}{{ .Result.title_filtered }}{{else}}{{ .Result.title_normal }}{{end}}" details: selector: "a.torrent-name" attribute: href From 102e7338f9a854de2a730115cb75fb6b96a31f1b Mon Sep 17 00:00:00 2001 From: Khogniak Date: Wed, 23 Aug 2017 10:24:34 +0200 Subject: [PATCH 2/3] Make regex case incesitive --- src/Jackett/Definitions/yggtorrent.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Jackett/Definitions/yggtorrent.yml b/src/Jackett/Definitions/yggtorrent.yml index 826951159..1c091fdb6 100755 --- a/src/Jackett/Definitions/yggtorrent.yml +++ b/src/Jackett/Definitions/yggtorrent.yml @@ -102,14 +102,13 @@ title_filtered: selector: "a.torrent-name" filters: - - name: tolower - name: re_replace - args: ["^(?:(.+?)((?:[\\.\\-\\s_\\[]+(?:imax|(?:dvd|bd|tv)(?:rip|scr)|bluray(?:\\-?rip)?|720\\s*p?|1080\\s*p?|vof?|vost(?:fr)?|multi|vf(?:f|q)?[1-3]?[1-3]?|(?:true)?french|eng?)[\\.\\-\\s_\\]]*)*)([\\(\\[]?(?:20|1[7-9])\\d{2}[\\)\\]]?)(.*)$|(.*))$", "$1 $3 $2 $4 $5"] + args: ["(?i)^(?:(.+?)((?:[\\.\\-\\s_\\[]+(?:imax|(?:dvd|bd|tv)(?:rip|scr)|bluray(?:\\-?rip)?|720\\s*p?|1080\\s*p?|vof?|vost(?:fr)?|multi|vf(?:f|q)?[1-3]?[1-3]?|(?:true)?french|eng?)[\\.\\-\\s_\\]]*)*)([\\(\\[]?(?:20|1[7-9])\\d{2}[\\)\\]]?)(.*)$|(.*))$", "$1 $3 $2 $4 $5"] - name: replace args: [".", " "] - name: trim - name: re_replace - args: ["\\s(mkv|avi|divx|xvid|mp4)$", ""] + args: ["(?i)\\s(mkv|avi|divx|xvid|mp4)$", ""] - name: re_replace args: ["(\\s{2,5})", " "] - name: trim From db42bc944bcd247fd31d39966172d1e627601ae1 Mon Sep 17 00:00:00 2001 From: Khogniak Date: Wed, 23 Aug 2017 10:34:12 +0200 Subject: [PATCH 3/3] Fixed typo in regex --- src/Jackett/Definitions/yggtorrent.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Jackett/Definitions/yggtorrent.yml b/src/Jackett/Definitions/yggtorrent.yml index 1c091fdb6..d87911340 100755 --- a/src/Jackett/Definitions/yggtorrent.yml +++ b/src/Jackett/Definitions/yggtorrent.yml @@ -103,7 +103,7 @@ selector: "a.torrent-name" filters: - name: re_replace - args: ["(?i)^(?:(.+?)((?:[\\.\\-\\s_\\[]+(?:imax|(?:dvd|bd|tv)(?:rip|scr)|bluray(?:\\-?rip)?|720\\s*p?|1080\\s*p?|vof?|vost(?:fr)?|multi|vf(?:f|q)?[1-3]?[1-3]?|(?:true)?french|eng?)[\\.\\-\\s_\\]]*)*)([\\(\\[]?(?:20|1[7-9])\\d{2}[\\)\\]]?)(.*)$|(.*))$", "$1 $3 $2 $4 $5"] + args: ["(?i)^(?:(.+?)((?:[\\.\\-\\s_\\[]+(?:imax|(?:dvd|bd|tv)(?:rip|scr)|bluray(?:\\-?rip)?|720\\s*p?|1080\\s*p?|vof?|vost(?:fr)?|multi|vf(?:f|q)?[1-3]?|(?:true)?french|eng?)[\\.\\-\\s_\\]]*)*)([\\(\\[]?(?:20|1[7-9])\\d{2}[\\)\\]]?)(.*)$|(.*))$", "$1 $3 $2 $4 $5"] - name: replace args: [".", " "] - name: trim