diff --git a/src/Jackett.Common/Definitions/manicomioshare.yml b/src/Jackett.Common/Definitions/manicomioshare.yml index 563fe4816..58890893b 100644 --- a/src/Jackett.Common/Definitions/manicomioshare.yml +++ b/src/Jackett.Common/Definitions/manicomioshare.yml @@ -218,6 +218,8 @@ # workaroud to remove year in search keywords - name: re_replace args: ["([1-2]\\d{3})", ""] + - name: replace + args: ["Agents of SHIELD", "Agents of S.H.I.E.L.D."] - name: re_replace args: ["[^a-zA-Z0-9]+", "%"] inputs: @@ -245,6 +247,27 @@ args: ["|", ""] - name: replace args: ["Ep. ","E"] + - name: re_replace + args: ["(\\d{2})[ºª°] Temporada( Completa)?", "S$1"] + - name: re_replace + args: ["(\\d{1})[ºª°] Temporada( Completa)?", "S0$1"] + # Workaround to add year to series that is an remake, since the year returned from the tracker isn't reliable, feel free to add more as needed. + - name: re_replace + args: ["^Doctor Who", "Doctor Who 2005"] + - name: re_replace + args: ["^Extinct", "Extinct 2017"] + - name: re_replace + args: ["^The Flash", "The Flash 2014"] + - name: re_replace + args: ["^The Magicians", "The Magicians 2015"] + # Workaround to remove the translated name from the series, didn't found an better and reliable way to do this, feel free to add more as needed. + - name: replace + args: ["O Sócio - The Profit", "The Profit"] + - name: replace + args: ["Arquivo X - The X Files", "The X Files"] + - name: replace + args: ["Deuses Americanos - American Gods", "American Gods"] + size: selector: td:nth-child(4) grabs: diff --git a/src/Jackett.Common/Definitions/mvgroupforum.yml b/src/Jackett.Common/Definitions/mvgroupforum.yml index 68ed433ad..5e0174683 100644 --- a/src/Jackett.Common/Definitions/mvgroupforum.yml +++ b/src/Jackett.Common/Definitions/mvgroupforum.yml @@ -130,20 +130,14 @@ selector: tr:has(a.magnetlink) fields: title: - # fallback title (to prevent abend if neither optional is found) + # fallback title (to prevent abend if optional is not found) text: "title not found" title: optional: true - selector: td.singleindent a[href^="/index.php?showtopic="] + selector: td.doubleindent, td.singleindent a[href^="/index.php?showtopic="] filters: - name: re_replace - args: ["BBC (.*)", "{{ if .Config.dropbbc }}{{ else }}BBC {{ end }}$1"] - title: - optional: true - selector: td.doubleindent - filters: - - name: re_replace - args: ["BBC (.*)", "{{ if .Config.dropbbc }}{{ else }}BBC {{ end }}$1"] + args: ["^BBC (.*)", "{{ if .Config.dropbbc }}{{ else }}BBC {{ end }}$1"] details: optional: true selector: td.singleindent a[href^="/index.php?showtopic="] diff --git a/src/Jackett.Common/Definitions/mvgroupmain.yml b/src/Jackett.Common/Definitions/mvgroupmain.yml index 25d2a4c00..9477026bf 100644 --- a/src/Jackett.Common/Definitions/mvgroupmain.yml +++ b/src/Jackett.Common/Definitions/mvgroupmain.yml @@ -130,20 +130,14 @@ selector: tr:has(a.magnetlink) fields: title: - # fallback title (to prevent abend if neither optional is found) + # fallback title (to prevent abend if optional is not found) text: "title not found" title: optional: true - selector: td.singleindent a[href^="/index.php?showtopic="] + selector: td.doubleindent, td.singleindent a[href^="/index.php?showtopic="] filters: - name: re_replace - args: ["BBC (.*)", "{{ if .Config.dropbbc }}{{ else }}BBC {{ end }}$1"] - title: - optional: true - selector: td.doubleindent - filters: - - name: re_replace - args: ["BBC (.*)", "{{ if .Config.dropbbc }}{{ else }}BBC {{ end }}$1"] + args: ["^BBC (.*)", "{{ if .Config.dropbbc }}{{ else }}BBC {{ end }}$1"] details: optional: true selector: td.singleindent a[href^="/index.php?showtopic="] diff --git a/src/Jackett.Common/Definitions/speed-share.yml b/src/Jackett.Common/Definitions/speed-share.yml index c8b67e7a2..c27a7cbd9 100644 --- a/src/Jackett.Common/Definitions/speed-share.yml +++ b/src/Jackett.Common/Definitions/speed-share.yml @@ -196,6 +196,8 @@ # workaroud to remove year in search keywords - name: re_replace args: ["([1-2]\\d{3})", ""] + - name: replace + args: ["Agents of SHIELD", "Agents of S.H.I.E.L.D."] inputs: number: 100 offset: 0 @@ -220,11 +222,6 @@ ,a[href^="torrents.php?cat=228"] ,a[href^="torrents.php?cat=191"] attribute: href - year: - selector: td.label > div:contains("Lançamento:") - filters: - - name: replace - args: ["Lançamento:", ""] title_anime: selector: a[href^="torrents-details.php?id="] filters: @@ -234,7 +231,16 @@ selector: a[href^="torrents-details.php?id="] filters: - name: re_replace - args: ["^(.*?) - ((S(\\d{1,2}))?E(\\d{1,3}))", "$1 {{.Result.year}} $2"] + args: ["^(.*?) - ((S(\\d{1,2}))?E(\\d{1,3}))", "$1 $2"] + # Workaround to add year to series that is an remake, since the year returned from the tracker isn't reliable, feel free to add more as needed. + - name: re_replace + args: ["^Doctor Who", "Doctor Who 2005"] + - name: re_replace + args: ["^Extinct", "Extinct 2017"] + - name: re_replace + args: ["^The Flash", "The Flash 2014"] + - name: re_replace + args: ["^The Magicians", "The Magicians 2015"] title: text: "{{if .Result.is_anime }}{{ .Result.title_anime }}{{else}}{{ .Result.title_normal }}{{end}}" filters: @@ -243,15 +249,15 @@ - name: replace args: [" - NOVO!", ""] - name: re_replace - args: ["(\\d{2})ª a (\\d{2})ª Temporada", "S$1-$2"] + args: ["(\\d{2})[ºª°] a (\\d{2})[ºª°] Temporada", "S$1-$2"] - name: re_replace - args: ["(\\d{1})ª a (\\d{1})ª Temporada", "S0$1-0$2"] + args: ["(\\d{1})[ºª°] a (\\d{1})[ºª°] Temporada", "S0$1-0$2"] - name: re_replace - args: ["(\\d{1})ª a (\\d{2})ª Temporada", "S0$1-$2"] + args: ["(\\d{1})[ºª°] a (\\d{2})[ºª°] Temporada", "S0$1-$2"] - name: re_replace - args: ["(\\d{2})ª Temporada", "S$1"] + args: ["(\\d{2})[ºª°] Temporada", "S$1"] - name: re_replace - args: ["(\\d{1})ª Temporada", "S0$1"] + args: ["(\\d{1})[ºª°] Temporada", "S0$1"] title|append: optional: true selector: td.label > div:contains("Qualidade:") @@ -260,6 +266,18 @@ args: ["Qualidade:", ""] - name: replace args: ["Autorado", ""] + title|append: + optional: true + selector: td.label > div:contains("Resolução:") + filters: + - name: replace + args: ["Resolução:", ""] + - name: re_replace + args: ["(\\d{3,4})[ ]?x[ ]?(1[0-9][0-9][0-9])", "1080p"] + - name: re_replace + args: ["(\\d{3,4})[ ]?x[ ]?([2-9][0-9][0-9][0-9])", "2160p"] + - name: re_replace + args: ["(\\d{3,4})[ ]?x[ ]?([7-9][0-9][0-9])", "720p"] download: selector: a[href^="torrents-details.php?id="] attribute: href diff --git a/src/Jackett.Common/Indexers/BJShare.cs b/src/Jackett.Common/Indexers/BJShare.cs index c3e6e098f..e20860ea2 100644 --- a/src/Jackett.Common/Indexers/BJShare.cs +++ b/src/Jackett.Common/Indexers/BJShare.cs @@ -94,17 +94,21 @@ Encoding = Encoding.UTF8; { // Search does not support searching with episode numbers so strip it if we have one // Ww AND filter the result later to archive the proper result - return isAnime ? term.TrimEnd(digits) : Regex.Replace(term, @"[S|E]\d\d", string.Empty).Trim(); + if (isAnime) + { + return term.TrimEnd(digits); + } + + var ret = Regex.Replace(term, @"[S|E]\d\d", string.Empty).Trim(); + return ret.Replace("Agents of SHIELD", "Agents of S.H.I.E.L.D."); } protected override async Task> PerformQuery(TorznabQuery query) { var releases = new List(); - var searchString = query.GetQueryString(); - // if the search string is empty use the "last 24h torrents" view - if (string.IsNullOrWhiteSpace(searchString)) + if (string.IsNullOrWhiteSpace(query.SearchTerm)) { var results = await RequestStringWithCookies(TodayUrl); try @@ -199,14 +203,19 @@ Encoding = Encoding.UTF8; { var searchUrl = BrowseUrl; var isSearchAnime = query.Categories.Any(s => s == TorznabCatType.TVAnime.ID); + + query.SearchTerm = query.SearchTerm.Replace("Agents of SHIELD", "Agents of S.H.I.E.L.D."); + var searchString = query.GetQueryString(); - var queryCollection = new NameValueCollection(); - queryCollection.Add("searchstr", StripSearchString(searchString, isSearchAnime)); - queryCollection.Add("order_by", "time"); - queryCollection.Add("order_way", "desc"); - queryCollection.Add("group_results", "1"); - queryCollection.Add("action", "basic"); - queryCollection.Add("searchsubmit", "1"); + var queryCollection = new NameValueCollection + { + {"searchstr", StripSearchString(searchString, isSearchAnime)}, + {"order_by", "time"}, + {"order_way", "desc"}, + {"group_results", "1"}, + {"action", "basic"}, + {"searchsubmit", "1"} + }; foreach (var cat in MapTorznabCapsToTrackers(query)) {