From 1f30b653d1eecf5022de920e99cd908f171a3af7 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Thu, 16 Feb 2023 21:05:11 +0200 Subject: [PATCH] uhdbits: fix parsing the last word as release group for music (#14031) --- src/Jackett.Common/Definitions/uhdbits.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Jackett.Common/Definitions/uhdbits.yml b/src/Jackett.Common/Definitions/uhdbits.yml index 595387cb9..43faf4ad2 100644 --- a/src/Jackett.Common/Definitions/uhdbits.yml +++ b/src/Jackett.Common/Definitions/uhdbits.yml @@ -94,13 +94,15 @@ search: selector: table#torrent_table > tbody > tr.torrent fields: - category: + # note: there are optional extra colums + category_id: selector: a[href^="torrents.php?filter_cat"] attribute: href filters: - name: regexp args: "\\[(\\d+)\\]" - # note: there are optional extra colums + category: + text: "{{ .Result.category_id }}" download: selector: a[href^="torrents.php?action=download&id="] attribute: href @@ -157,7 +159,7 @@ search: - name: replace args: [" / ", " "] - name: re_replace - args: ["\\b([\\w@\\.]+)$", " -$1"] + args: ["\\s+([\\w@\\.\\[\\]\\$\\-\\!\\u2122]+)$", " -$1"] - name: re_replace args: ["\\bEncode\\b", "Blu-Ray"] - name: re_replace @@ -166,6 +168,16 @@ search: args: ["\\bRemux\\b", "Blu-Ray Remux"] - name: re_replace args: ["\\s+", " "] + _release_info_music: + selector: div.torrent_info + remove: .torrent_label.red, .torrent_label.blink_me + filters: + - name: re_replace + args: ["[\\s\\/]+$", ""] + - name: replace + args: [" / ", " "] + - name: re_replace + args: ["\\s+", " "] title: selector: div.group_info remove: span, div.tags, div.torrent_info @@ -174,5 +186,5 @@ search: args: ["(?i)\\bSeason (\\d+)\\b", "S$1"] - name: trim - name: append - args: " {{ .Result._release_info }}" + args: " {{ if eq .Result.category_id \"2\" }}{{ .Result._release_info_music }}{{ else }}{{ .Result._release_info }}{{ end }}" # Gazelle