nyaasi: add prefer magnet link setting

Co-authored-by: mynameisbogdan <mynameisbogdan@users.noreply.github.com>
This commit is contained in:
ilike2burnthing 2023-03-03 19:32:26 +00:00 committed by GitHub
parent 6e20120c72
commit 80691060ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -27,6 +27,10 @@ legacylinks:
- https://nyaa.nocensor.art/
settings:
- name: prefer_magnet_links
type: checkbox
label: Prefer Magnet Links
default: true
- name: filter-id
type: select
label: Filter
@ -155,10 +159,13 @@ search:
details:
selector: td:nth-child(2) a:last-of-type
attribute: href
download:
download_optional:
selector: td:nth-child(3) a[href$=".torrent"]
attribute: href
optional: true
download:
text: "{{ if .Config.prefer_magnet_links }}{{ else }}{{ .Result.download_optional }}{{ end }}"
optional: true
magnet:
selector: td:nth-child(3) a[href^="magnet:?"]
attribute: href