From 7fbb6efa871dbefea6ab0678fc99b02bab0c11ed Mon Sep 17 00:00:00 2001 From: ilike2burnthing <59480337+ilike2burnthing@users.noreply.github.com> Date: Wed, 8 Nov 2023 02:29:30 +0000 Subject: [PATCH] assorted: simplify use of sitelink for results fields (#14832) --- src/Jackett.Common/Definitions/anilibria.yml | 7 +++---- src/Jackett.Common/Definitions/animetime.yml | 2 +- src/Jackett.Common/Definitions/bangumi-moe.yml | 2 +- src/Jackett.Common/Definitions/danishbytes-api.yml | 4 ++-- src/Jackett.Common/Definitions/digitalcore.yml | 6 +++--- src/Jackett.Common/Definitions/hebits.yml | 4 ++-- src/Jackett.Common/Definitions/milkie.yml | 4 ++-- src/Jackett.Common/Definitions/nipponsei.yml | 2 +- src/Jackett.Common/Definitions/showrss.yml | 2 +- src/Jackett.Common/Definitions/superbits.yml | 6 +++--- src/Jackett.Common/Definitions/torrentleech.yml | 4 ++-- src/Jackett.Common/Definitions/torrentmasters.yml | 2 +- src/Jackett.Common/Definitions/torrentz2eu.yml | 3 +-- src/Jackett.Common/Definitions/yggcookie.yml | 2 +- src/Jackett.Common/Definitions/yggtorrent.yml | 2 +- 15 files changed, 25 insertions(+), 27 deletions(-) diff --git a/src/Jackett.Common/Definitions/anilibria.yml b/src/Jackett.Common/Definitions/anilibria.yml index c5a557107..491aa9bc6 100644 --- a/src/Jackett.Common/Definitions/anilibria.yml +++ b/src/Jackett.Common/Definitions/anilibria.yml @@ -89,11 +89,10 @@ search: selector: ..code details: text: "{{ .Config.sitelink }}release/{{ .Result._code }}.html" - download: + download_url: selector: url - filters: - - name: prepend - args: "{{ .Config.sitelink }}" + download: + text: "{{ .Config.sitelink }}{{ .Result.download_url }}" magnet: selector: magnet poster: diff --git a/src/Jackett.Common/Definitions/animetime.yml b/src/Jackett.Common/Definitions/animetime.yml index 387d0c8a2..d5916db10 100644 --- a/src/Jackett.Common/Definitions/animetime.yml +++ b/src/Jackett.Common/Definitions/animetime.yml @@ -41,7 +41,7 @@ search: title: selector: div.flex.flex-wrap ~ p details: - text: "{{ .Config.sitelink }}search?query={{ .Result.title }}" + text: / download: selector: a[href*="/download/"] attribute: href diff --git a/src/Jackett.Common/Definitions/bangumi-moe.yml b/src/Jackett.Common/Definitions/bangumi-moe.yml index 81a9123a5..c78a226e6 100644 --- a/src/Jackett.Common/Definitions/bangumi-moe.yml +++ b/src/Jackett.Common/Definitions/bangumi-moe.yml @@ -50,7 +50,7 @@ search: title: selector: title details: - text: "{{ .Config.sitelink }}" + text: / infohash: selector: infoHash poster: diff --git a/src/Jackett.Common/Definitions/danishbytes-api.yml b/src/Jackett.Common/Definitions/danishbytes-api.yml index 0c571a21f..6708abc93 100644 --- a/src/Jackett.Common/Definitions/danishbytes-api.yml +++ b/src/Jackett.Common/Definitions/danishbytes-api.yml @@ -107,9 +107,9 @@ search: title: selector: name details: - text: "{{ .Config.sitelink }}torrents/{{ .Result._id }}" + text: "/torrents/{{ .Result._id }}" download: - text: "{{ .Config.sitelink }}torrent/download/{{ .Result._id }}.{{ .Config.rsskey }}" + text: "/torrent/download/{{ .Result._id }}.{{ .Config.rsskey }}" infohash: selector: info_hash poster: diff --git a/src/Jackett.Common/Definitions/digitalcore.yml b/src/Jackett.Common/Definitions/digitalcore.yml index 371bc5eed..63336cb4c 100644 --- a/src/Jackett.Common/Definitions/digitalcore.yml +++ b/src/Jackett.Common/Definitions/digitalcore.yml @@ -137,9 +137,9 @@ search: _id: selector: id details: - text: "{{ .Config.sitelink }}torrent/{{ .Result._id }}/" + text: "/torrent/{{ .Result._id }}/" download: - text: "{{ .Config.sitelink }}api/v1/torrents/download/{{ .Result._id }}" + text: "/api/v1/torrents/download/{{ .Result._id }}" imdbid: selector: imdbid2 imdbid_full: @@ -150,7 +150,7 @@ search: selector: firstpic poster_imdb: optional: true - text: "{{ if .Result.imdbid }}{{ .Config.sitelink }}img/imdb/{{ .Result.imdbid_full }}.jpg{{ else }}{{ end }}" + text: "{{ if .Result.imdbid }}/img/imdb/{{ .Result.imdbid_full }}.jpg{{ else }}{{ end }}" poster: text: "{{ if .Result.poster_imdb }}{{ .Result.poster_imdb }}{{ else }}{{ .Result.poster_normal }}{{ end }}" date: diff --git a/src/Jackett.Common/Definitions/hebits.yml b/src/Jackett.Common/Definitions/hebits.yml index 4fd8633b0..7131d05fd 100644 --- a/src/Jackett.Common/Definitions/hebits.yml +++ b/src/Jackett.Common/Definitions/hebits.yml @@ -112,9 +112,9 @@ search: title: text: "{{ if .Result.title_notenglish }}{{ .Result.title_notenglish }}{{ else }}{{ .Result.title_english }}{{ end }}" details: - text: "{{ .Config.sitelink }}torrents.php?torrentid={{ .Result._id }}" + text: "/torrents.php?torrentid={{ .Result._id }}" download: - text: "{{ .Config.sitelink }}torrents.php?action=download&id={{ .Result._id }}" + text: "/torrents.php?action=download&id={{ .Result._id }}" poster: selector: ..cover imdbid: diff --git a/src/Jackett.Common/Definitions/milkie.yml b/src/Jackett.Common/Definitions/milkie.yml index 966826e16..ea6f1c0f8 100644 --- a/src/Jackett.Common/Definitions/milkie.yml +++ b/src/Jackett.Common/Definitions/milkie.yml @@ -61,13 +61,13 @@ search: title: selector: releaseName details: - text: "{{ .Config.sitelink }}browse/{{ .Result._id }}" + text: "/browse/{{ .Result._id }}" _apikey: text: "{{ .Config.apikey }}" filters: - name: urlencode download: - text: "{{ .Config.sitelink }}api/v1/torrents/{{ .Result._id }}/torrent?key={{ .Result._apikey }}" + text: "/api/v1/torrents/{{ .Result._id }}/torrent?key={{ .Result._apikey }}" date: selector: createdAt size: diff --git a/src/Jackett.Common/Definitions/nipponsei.yml b/src/Jackett.Common/Definitions/nipponsei.yml index 98b9050e2..8bb8b184a 100644 --- a/src/Jackett.Common/Definitions/nipponsei.yml +++ b/src/Jackett.Common/Definitions/nipponsei.yml @@ -38,7 +38,7 @@ search: - name: replace args: ["[Nipponsei] ", ""] details: - text: "{{ .Config.sitelink }}" + text: / download: selector: a attribute: href diff --git a/src/Jackett.Common/Definitions/showrss.yml b/src/Jackett.Common/Definitions/showrss.yml index 0e19f99f4..01989d4c7 100644 --- a/src/Jackett.Common/Definitions/showrss.yml +++ b/src/Jackett.Common/Definitions/showrss.yml @@ -40,7 +40,7 @@ search: title: selector: raw_title details: - text: "{{ .Config.sitelink }}" + text: / date: selector: pubDate download: diff --git a/src/Jackett.Common/Definitions/superbits.yml b/src/Jackett.Common/Definitions/superbits.yml index c2efa0697..cd028ad4d 100644 --- a/src/Jackett.Common/Definitions/superbits.yml +++ b/src/Jackett.Common/Definitions/superbits.yml @@ -127,9 +127,9 @@ search: _id: selector: id details: - text: "{{ .Config.sitelink }}torrent/{{ .Result._id }}/" + text: "/torrent/{{ .Result._id }}/" download: - text: "{{ .Config.sitelink }}api/v1/torrents/download/{{ .Result._id }}" + text: "/api/v1/torrents/download/{{ .Result._id }}" imdbid: selector: imdbid2 imdbid_full: @@ -140,7 +140,7 @@ search: selector: customcover poster_imdb: optional: true - text: "{{ if .Result.imdbid }}{{ .Config.sitelink }}img/imdb/{{ .Result.imdbid_full }}.jpg{{ else }}{{ end }}" + text: "{{ if .Result.imdbid }}/img/imdb/{{ .Result.imdbid_full }}.jpg{{ else }}{{ end }}" poster: text: "{{ if .Result.poster_imdb }}{{ .Result.poster_imdb }}{{ else }}{{ .Result.poster_normal }}{{ end }}" date: diff --git a/src/Jackett.Common/Definitions/torrentleech.yml b/src/Jackett.Common/Definitions/torrentleech.yml index 484f3aab9..f6e9e548f 100644 --- a/src/Jackett.Common/Definitions/torrentleech.yml +++ b/src/Jackett.Common/Definitions/torrentleech.yml @@ -174,9 +174,9 @@ search: _filename: selector: filename details: - text: "{{ .Config.sitelink }}torrent/{{ .Result._id }}" + text: "/torrent/{{ .Result._id }}" download: - text: "{{ .Config.sitelink }}download/{{ .Result._id }}/{{ .Result._filename }}" + text: "/download/{{ .Result._id }}/{{ .Result._filename }}" genre: selector: tags filters: diff --git a/src/Jackett.Common/Definitions/torrentmasters.yml b/src/Jackett.Common/Definitions/torrentmasters.yml index a7560e453..d7bff8819 100644 --- a/src/Jackett.Common/Definitions/torrentmasters.yml +++ b/src/Jackett.Common/Definitions/torrentmasters.yml @@ -137,7 +137,7 @@ search: - name: regexp args: (\d+) download: - text: "{{ .Config.sitelink }}download/{{ .Result._id }}/" + text: "/download/{{ .Result._id }}/" title_hungarian: selector: a[href^="/details/"] attribute: title diff --git a/src/Jackett.Common/Definitions/torrentz2eu.yml b/src/Jackett.Common/Definitions/torrentz2eu.yml index 6b6b21dc3..755046cf7 100644 --- a/src/Jackett.Common/Definitions/torrentz2eu.yml +++ b/src/Jackett.Common/Definitions/torrentz2eu.yml @@ -94,8 +94,7 @@ search: # some tv have category as video() which can also be movies, so we look for the SxxExx to tag TV text: "{{ if .Result.category_is_tv_show }}Video(TV shows){{ else }}{{ .Result.category_provided }}{{ end }}" details: - # there is no details page so we use the sitelink - text: "{{ .Config.sitelink }}" + text: / download: selector: a[href^="magnet:?"] attribute: href diff --git a/src/Jackett.Common/Definitions/yggcookie.yml b/src/Jackett.Common/Definitions/yggcookie.yml index 4b0a2be66..d84da74b2 100644 --- a/src/Jackett.Common/Definitions/yggcookie.yml +++ b/src/Jackett.Common/Definitions/yggcookie.yml @@ -437,7 +437,7 @@ search: category: selector: td:nth-child(1) > div.hidden download: - text: "{{ .Config.sitelink }}engine/download_torrent?id={{ .Result._id }}" + text: "/engine/download_torrent?id={{ .Result._id }}" date: # unix selector: td:nth-child(5) > div.hidden diff --git a/src/Jackett.Common/Definitions/yggtorrent.yml b/src/Jackett.Common/Definitions/yggtorrent.yml index 7b5d64e07..d0bf006e0 100644 --- a/src/Jackett.Common/Definitions/yggtorrent.yml +++ b/src/Jackett.Common/Definitions/yggtorrent.yml @@ -441,7 +441,7 @@ search: category: selector: td:nth-child(1) > div.hidden download: - text: "{{ .Config.sitelink }}engine/download_torrent?id={{ .Result._id }}" + text: "/engine/download_torrent?id={{ .Result._id }}" date: # unix selector: td:nth-child(5) > div.hidden