assorted yml: use default: statement for optional fields

This commit is contained in:
Garfield69 2023-03-21 18:22:37 +13:00
parent 36abce2ef9
commit dbf1d43744
15 changed files with 41 additions and 57 deletions

View File

@ -138,11 +138,10 @@ search:
selector: a[href^="index.php?page=peers"]
leechers:
selector: td:has(a[href^="index.php?page=peers"]) + td
grabs_optional:
grabs:
selector: a[href^="index.php?page=torrent_history"]
optional: true
grabs:
text: "{{ if .Result.grabs_optional }}{{ .Result.grabs_optional }}{{ else }}0{{ end }}"
default: 0
downloadvolumefactor:
case:
img[src="images/50off.png"]: 0.5

View File

@ -135,11 +135,10 @@ search:
text: 1
leechers:
text: 1
size_optional:
optional: true
selector: b.file_size
size:
text: "{{ if .Result.size_optional }}{{ .Result.size_optional }}{{ else }}0 B{{ end }}"
selector: b.file_size
optional: true
default: 0 B
downloadvolumefactor:
text: 0
uploadvolumefactor:

View File

@ -64,11 +64,10 @@ search:
date:
# 2021-10-19T06:10:15.772Z
selector: publish_time
size_optional:
optional: true
selector: size
size:
text: "{{ if .Result.size_optional }}{{ .Result.size_optional }}{{ else }}0 B{{ end }}"
selector: size
optional: true
default: 0 B
grabs:
selector: downloads
seeders:

View File

@ -125,14 +125,13 @@ search:
selector: td:nth-child(6) > u
downloadvolumefactor:
text: 0
uploadvolumefactor_optional:
optional: true
uploadvolumefactor:
selector: td:nth-child(5) > nobr > font:contains(" × ")
optional: true
default: 1
filters:
- name: replace
args: ["×", ""]
uploadvolumefactor:
text: "{{ if .Result.uploadvolumefactor_optional }}{{ .Result.uploadvolumefactor_optional }}{{ else }}1{{ end }}"
date_year:
selector: td:nth-child(5):contains('.')
optional: true

View File

@ -106,11 +106,10 @@ search:
poster:
selector: img[src*="/thbx/imgx/"]
attribute: src
files_optional:
files:
selector: a[href$="filelist=1"]
optional: true
files:
text: "{{ if .Result.files_optional }}{{ .Result.files_optional }}{{ else }}1{{ end }}"
default: 1
size:
selector: td:nth-child(3)
optional: true

View File

@ -71,11 +71,10 @@ search:
filters:
- name: replace
args: ["found ", ""]
files_optional:
files:
selector: span.torrent_files
optional: true
files:
text: "{{ if .Result.files_optional }}{{ .Result.files_optional }}{{ else }}1{{ end }}"
default: 1
size:
selector: span.torrent_size
seeders:

View File

@ -132,11 +132,10 @@ search:
attribute: href
size:
selector: td:nth-child(2)
files_optional:
files:
selector: td:nth-child(3)
optional: true
files:
text: "{{ if .Result.files_optional }}{{ .Result.files_optional }}{{ else }}0{{ end }}"
default: 1
date:
selector: td:nth-child(4)
seeders:

View File

@ -90,11 +90,10 @@ search:
download:
selector: td:nth-child(3) a.magnet, td:nth-child(3) a
attribute: href
size_optional:
optional: true
selector: td:nth-child(4)
size:
text: "{{ if .Result.size_optional }}{{ .Result.size_optional }}{{ else }}512 MB{{ end }}"
selector: td:nth-child(4)
optional: true
default: 512 MB
date:
selector: td:nth-child(5)
filters:

View File

@ -145,22 +145,20 @@ search:
selector: td:nth-child(7)
files:
selector: td:nth-child(4)
downloadvolumefactor_optional:
downloadvolumefactor:
selector: td:nth-child(6) > span:nth-last-child(2)
optional: true
default: 1
filters:
- name: trim
args: "x"
downloadvolumefactor:
text: "{{ if .Result.downloadvolumefactor_optional }}{{ .Result.downloadvolumefactor_optional }}{{ else }}1{{ end }}"
uploadvolumefactor_optional:
args: x
uploadvolumefactor:
selector: td:nth-child(6) > span:nth-last-child(1)
optional: true
default: 1
filters:
- name: trim
args: "x"
uploadvolumefactor:
text: "{{ if .Result.uploadvolumefactor_optional }}{{ .Result.uploadvolumefactor_optional }}{{ else }}1{{ end }}"
args: x
minimumratio:
text: 0.5
minimumseedtime:

View File

@ -241,15 +241,14 @@ search:
img[alt="Silver 50% Free"]: 0.5
img[alt="Bronze 25% Free"]: 0.75
"*": 1
uploadvolumefactor_optional:
optional: true
uploadvolumefactor:
selector: img[alt$="x Upload Multiplier"]
attribute: alt
optional: true
default: 1
filters:
- name: replace
args: ["x Upload Multiplier", ""]
uploadvolumefactor:
text: "{{ if .Result.uploadvolumefactor_optional }}{{ .Result.uploadvolumefactor_optional }}{{ else }}1{{ end }}"
minimumratio:
text: 0.5
# xbtitFM 3.1.00

View File

@ -282,11 +282,10 @@ search:
args: f
description:
selector: td span.iconDL
size_optional:
size:
selector: td:nth-last-child(5) > u
optional: true
size:
text: "{{ if .Result.size_optional }}{{ .Result.size_optional }}{{ else }}0 B{{ end }}"
default: 0 B
seeders:
selector: td.seedmed
leechers:

View File

@ -50,11 +50,10 @@ search:
args: "yyyy-MM-dd HH:mm"
date:
text: "{{ if .Result.date_optional }}{{ .Result.date_optional }}{{ else }}now{{ end }}"
size_optional:
optional: true
selector: td.bytes
size:
text: "{{ if .Result.size_optional }}{{ .Result.size_optional }}{{ else }}128 MB{{ end }}"
selector: td.bytes
optional: true
default: 128 MB
seeders:
selector: "{{ if .Keywords }}td:nth-child(2){{ else }}td:nth-child(4){{ end }}"
leechers:

View File

@ -167,11 +167,10 @@ search:
download:
selector: a.topictitle
attribute: href
size_optional:
size:
selector: div.list-inner div[style="float:right;"]
optional: true
size:
text: "{{ if .Result.size_optional }}{{ .Result.size_optional }}{{ else }}1 GB{{ end }}"
default: 1 GB
seeders:
selector: dd.posts span.my_tt.seed
optional: true

View File

@ -150,11 +150,10 @@ search:
selector: size
files:
selector: numfiles
grabs_optional:
optional: true
selector: timesCompleted
grabs:
text: "{{ if .Result.grabs_optional }}{{ .Result.grabs_optional }}{{ else }}0{{ end }}"
selector: timesCompleted
optional: true
default: 0
seeders:
selector: seeders
leechers:

View File

@ -152,12 +152,11 @@ search:
attribute: href
files:
selector: td:nth-child(5)
size_optional:
size:
selector: td:nth-child(11):has(b)
optional: true
default: 0 B
remove: b
size:
text: "{{ if .Result.size_optional }}{{ .Result.size_optional }}{{ else }}0 B{{ end }}"
seeders:
selector: td:nth-child(7)
leechers: