assorted: simplify use of sitelink for results fields (#14832)

This commit is contained in:
ilike2burnthing 2023-11-08 02:29:30 +00:00 committed by GitHub
parent 667fdd1353
commit 7fbb6efa87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 25 additions and 27 deletions

View File

@ -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:

View File

@ -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

View File

@ -50,7 +50,7 @@ search:
title:
selector: title
details:
text: "{{ .Config.sitelink }}"
text: /
infohash:
selector: infoHash
poster:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -38,7 +38,7 @@ search:
- name: replace
args: ["[Nipponsei] ", ""]
details:
text: "{{ .Config.sitelink }}"
text: /
download:
selector: a
attribute: href

View File

@ -40,7 +40,7 @@ search:
title:
selector: raw_title
details:
text: "{{ .Config.sitelink }}"
text: /
date:
selector: pubDate
download:

View File

@ -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:

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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