Skip to content

Commit

Permalink
assorted yml: use default: statement for optional fields
Browse files Browse the repository at this point in the history
  • Loading branch information
garfield69 committed Mar 21, 2023
1 parent 36abce2 commit dbf1d43
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 57 deletions.
5 changes: 2 additions & 3 deletions src/Jackett.Common/Definitions/3dtorrents.yml
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions src/Jackett.Common/Definitions/anime-free.yml
Expand Up @@ -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:
Expand Down
7 changes: 3 additions & 4 deletions src/Jackett.Common/Definitions/bangumi-moe.yml
Expand Up @@ -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:
Expand Down
7 changes: 3 additions & 4 deletions src/Jackett.Common/Definitions/bithumen.yml
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/Jackett.Common/Definitions/bootytape.yml
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/Jackett.Common/Definitions/btdigg.yml
Expand Up @@ -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:
Expand Down
5 changes: 2 additions & 3 deletions src/Jackett.Common/Definitions/exttorrents.yml
Expand Up @@ -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:
Expand Down
7 changes: 3 additions & 4 deletions src/Jackett.Common/Definitions/eztv.yml
Expand Up @@ -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:
Expand Down
14 changes: 6 additions & 8 deletions src/Jackett.Common/Definitions/gigatorrents.yml
Expand Up @@ -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:
Expand Down
7 changes: 3 additions & 4 deletions src/Jackett.Common/Definitions/girotorrent.yml
Expand Up @@ -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
5 changes: 2 additions & 3 deletions src/Jackett.Common/Definitions/marinetracker.yml
Expand Up @@ -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:
Expand Down
7 changes: 3 additions & 4 deletions src/Jackett.Common/Definitions/nipponsei.yml
Expand Up @@ -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:
Expand Down
5 changes: 2 additions & 3 deletions src/Jackett.Common/Definitions/pier720.yml
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions src/Jackett.Common/Definitions/superbits.yml
Expand Up @@ -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:
Expand Down
5 changes: 2 additions & 3 deletions src/Jackett.Common/Definitions/ztracker.yml
Expand Up @@ -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:
Expand Down

0 comments on commit dbf1d43

Please sign in to comment.