Skip to content

Commit

Permalink
assorted yml: use default: statement for optional fields
Browse files Browse the repository at this point in the history
Size, Seeders, Leechers. Grabs
  • Loading branch information
garfield69 committed Mar 20, 2023
1 parent 0f9f173 commit 76e5157
Show file tree
Hide file tree
Showing 21 changed files with 113 additions and 163 deletions.
26 changes: 11 additions & 15 deletions src/Jackett.Common/Definitions/Bittorrentfiles.yml
Expand Up @@ -156,43 +156,39 @@ search:
selector: table.tableinborder > tbody > tr:has(a[href^="/download.php"])

fields:
title:
selector: a[href^="details.php"]
attribute: title
category:
selector: a[href^="/browse.php?cat="]
attribute: href
filters:
- name: querystring
args: cat
title:
selector: a[href^="details.php"]
attribute: title
details:
selector: a[href^="details.php"]
attribute: href
download:
selector: a[href^="/download.php"]
attribute: href
grabs_optional:
grabs:
selector: a[title="Snatcher"]
optional: true
grabs:
text: "{{ if .Result.grabs_optional }}{{ .Result.grabs_optional }}{{ else }}0{{ end }}"
files_optional:
default: 0
files:
selector: a[title="Files"]
optional: true
files:
text: "{{ if .Result.files_optional }}{{ .Result.files_optional }}{{ else }}0{{ end }}"
default: 0
size:
selector: td:nth-child(6)
seeders_optional:
seeders:
selector: a[title="Seeder"]
optional: true
seeders:
text: "{{ if .Result.seeders_optional }}{{ .Result.seeders_optional }}{{ else }}0{{ end }}"
leechers_optional:
default: 0
leechers:
selector: a[title="Leecher"]
optional: true
leechers:
text: "{{ if .Result.leechers_optional }}{{ .Result.leechers_optional }}{{ else }}0{{ end }}"
default: 0
# 2 flavours of dates
date_day:
# Heute 13:30:04
Expand Down
22 changes: 9 additions & 13 deletions src/Jackett.Common/Definitions/audionews.yml
Expand Up @@ -300,26 +300,22 @@ search:
filters:
- name: querystring
args: f
size_optional:
optional: true
selector: td:contains(\00a0GB), td:contains(\00a0MB), td:contains(\00a0kB), td:contains(\00a0B)
size:
text: "{{ if .Result.size_optional }}{{ .Result.size_optional }}{{ else }}0 B{{ end }}"
seeders_optional:
selector: td:contains(\00a0GB), td:contains(\00a0MB), td:contains(\00a0kB), td:contains(\00a0B)
optional: true
selector: td[title="Seeders"]
default: 0
seeders:
text: "{{ if .Result.seeders_optional }}{{ .Result.seeders_optional }}{{ else }}0{{ end }}"
leechers_optional:
selector: td[title="Seeders"]
optional: true
selector: td[title="Leechers"]
default: 0
leechers:
text: "{{ if .Result.leechers_optional }}{{ .Result.leechers_optional }}{{ else }}0{{ end }}"
grabs_optional:
selector: td[title="Leechers"]
optional: true
selector: td[title^="Replies:"]
default: 0
grabs:
text: "{{ if .Result.grabs_optional }}{{ .Result.grabs_optional }}{{ else }}0{{ end }}"
selector: td[title^="Replies:"]
optional: true
default: 0
downloadvolumefactor:
text: 1
uploadvolumefactor:
Expand Down
20 changes: 9 additions & 11 deletions src/Jackett.Common/Definitions/bibliotik.yml
Expand Up @@ -108,9 +108,10 @@ search:
selector: .title a
attribute: href
date:
optional: true
selector: .t_files_size_added time
attribute: datetime
optional: true
default: now
download:
selector: a[title="Download"]
attribute: href
Expand All @@ -122,21 +123,18 @@ search:
size:
selector: .t_files_size_added span
attribute: data-bytecount
seeders_optional:
optional: true
selector: .seeders
seeders:
text: "{{ if .Result.seeders_optional }}{{ .Result.seeders_optional }}{{ else }}0{{ end }}"
leechers_optional:
selector: .seeders
optional: true
selector: .leechers
default: 0
leechers:
text: "{{ if .Result.leechers_optional }}{{ .Result.leechers_optional }}{{ else }}0{{ end }}"
grabs_optional:
selector: .leechers
optional: true
selector: .snatches
default: 0
grabs:
text: "{{ if .Result.grabs_optional }}{{ .Result.grabs_optional }}{{ else }}0{{ end }}"
selector: .snatches
optional: true
default: 0
downloadvolumefactor:
text: 1
uploadvolumefactor:
Expand Down
10 changes: 4 additions & 6 deletions src/Jackett.Common/Definitions/cpabien.yml
Expand Up @@ -139,16 +139,14 @@ search:
selector: div.poid
date:
text: now
seeders_optional:
seeders:
selector: div.up
optional: true
seeders:
text: "{{ if .Result.seeders_optional }}{{ .Result.seeders_optional }}{{ else }}0{{ end }}"
leechers_optional:
default: 0
leechers:
selector: div.down
optional: true
leechers:
text: "{{ if .Result.leechers_optional }}{{ .Result.leechers_optional }}{{ else }}0{{ end }}"
default: 0
downloadvolumefactor:
text: 0
uploadvolumefactor:
Expand Down
10 changes: 4 additions & 6 deletions src/Jackett.Common/Definitions/cpasbienclone.yml
Expand Up @@ -139,16 +139,14 @@ search:
args: ["(\\d+)\\.\\d", "$1 MB"]
date:
text: now
seeders_optional:
seeders:
selector: div.up
optional: true
seeders:
text: "{{ if .Result.seeders_optional }}{{ .Result.seeders_optional }}{{ else }}0{{ end }}"
leechers_optional:
default: 0
leechers:
selector: div.down
optional: true
leechers:
text: "{{ if .Result.leechers_optional }}{{ .Result.leechers_optional }}{{ else }}0{{ end }}"
default: 0
downloadvolumefactor:
text: 0
uploadvolumefactor:
Expand Down
10 changes: 4 additions & 6 deletions src/Jackett.Common/Definitions/cpasbiensi.yml
Expand Up @@ -86,16 +86,14 @@ search:
selector: div.poid
date:
text: now
seeders_optional:
seeders:
selector: div.up
optional: true
seeders:
text: "{{ if .Result.seeders_optional }}{{ .Result.seeders_optional }}{{ else }}0{{ end }}"
leechers_optional:
default: 0
leechers:
selector: div.down
optional: true
leechers:
text: "{{ if .Result.leechers_optional }}{{ .Result.leechers_optional }}{{ else }}0{{ end }}"
default: 0
downloadvolumefactor:
text: 0
uploadvolumefactor:
Expand Down
12 changes: 5 additions & 7 deletions src/Jackett.Common/Definitions/extratorrent-st.yml
Expand Up @@ -132,16 +132,14 @@ search:
- name: timeago
size:
selector: td:nth-last-of-type(4)
seeders_optional:
optional: true
selector: td.sy, td.sn
seeders:
text: "{{ if .Result.seeders_optional }}{{ .Result.seeders_optional }}{{ else }}0{{ end }}"
leechers_optional:
selector: td.sy, td.sn
optional: true
selector: td.ly, td.ln
default: 0
leechers:
text: "{{ if .Result.leechers_optional }}{{ .Result.leechers_optional }}{{ else }}0{{ end }}"
selector: td.ly, td.ln
optional: true
default: 0
downloadvolumefactor:
text: 0
uploadvolumefactor:
Expand Down
12 changes: 5 additions & 7 deletions src/Jackett.Common/Definitions/extremetorrents.yml
Expand Up @@ -177,16 +177,14 @@ search:
args: " +01:00" # CET
- name: dateparse
args: "d MMMM yyyy HH:mm:ss zzz"
seeders_optional:
optional: true
selector: table tr:nth-child(3) td:nth-child(5) font b
seeders:
text: "{{ if .Result.seeders_optional }}{{ .Result.seeders_optional }}{{ else }}0{{ end }}"
leechers_optional:
selector: table tr:nth-child(3) td:nth-child(5) font b
optional: true
selector: table tr:nth-child(3) td:nth-child(5) font b:nth-child(2)
default: 0
leechers:
text: "{{ if .Result.leechers_optional }}{{ .Result.leechers_optional }}{{ else }}0{{ end }}"
selector: table tr:nth-child(3) td:nth-child(5) font b:nth-child(2)
optional: true
default: 0
downloadvolumefactor:
text: 0
uploadvolumefactor:
Expand Down
15 changes: 6 additions & 9 deletions src/Jackett.Common/Definitions/hdc.yml
Expand Up @@ -119,30 +119,27 @@ search:
size:
selector: div.trbo div:nth-last-child(8)
remove: i
seeders_optional:
seeders:
selector: div.trbo div:nth-last-child(7)
optional: true
default: 0
filters:
- name: re_replace
args: ["\\s", "0"]
seeders:
text: "{{ if .Result.seeders_optional }}{{ .Result.seeders_optional }}{{ else }}0{{ end }}"
leechers_optional:
leechers:
selector: div.trbo div:nth-last-child(6)
optional: true
default: 0
filters:
- name: re_replace
args: ["\\s", "0"]
leechers:
text: "{{ if .Result.leechers_optional }}{{ .Result.leechers_optional }}{{ else }}0{{ end }}"
grabs_optional:
grabs:
selector: div.trbo div:nth-last-child(5)
optional: true
default: 0
filters:
- name: re_replace
args: ["\\s", "0"]
grabs:
text: "{{ if .Result.grabs_optional }}{{ .Result.grabs_optional }}{{ else }}0{{ end }}"
date:
remove: a, span
selector: div[style="float:right;"]
Expand Down
10 changes: 4 additions & 6 deletions src/Jackett.Common/Definitions/hdtorrentsit.yml
Expand Up @@ -125,22 +125,20 @@ search:
attribute: href
size:
selector: td:nth-child(3)
seeders_optional:
seeders:
selector: td:nth-child(4)
optional: true
default: 1
filters:
- name: re_replace
args: ["(\\d*) \\(\\+\\d*\\)\n? \\| (\\d*) \\(\\+\\d*\\)", "$1"]
seeders:
text: "{{ if .Result.seeders_optional }}{{ .Result.seeders_optional }}{{ else }}1{{ end }}"
leechers_optional:
leechers:
selector: td:nth-child(4)
optional: true
default: 1
filters:
- name: re_replace
args: ["(\\d*) \\(\\+\\d*\\)\n? \\| (\\d*) \\(\\+\\d*\\)", "$2"]
leechers:
text: "{{ if .Result.leechers_optional }}{{ .Result.leechers_optional }}{{ else }}1{{ end }}"
date:
selector: td:nth-child(2) i
filters:
Expand Down
12 changes: 5 additions & 7 deletions src/Jackett.Common/Definitions/lightning-tor.yml
Expand Up @@ -155,16 +155,14 @@ search:
- name: append
args: " hours ago"
- name: timeago
seeders_optional:
optional: true
selector: table tr:nth-child(3) td:nth-child(5) font b
seeders:
text: "{{ if .Result.seeders_optional }}{{ .Result.seeders_optional }}{{ else }}0{{ end }}"
leechers_optional:
selector: table tr:nth-child(3) td:nth-child(5) font b
optional: true
selector: table tr:nth-child(3) td:nth-child(5) font b:nth-child(2)
default: 0
leechers:
text: "{{ if .Result.leechers_optional }}{{ .Result.leechers_optional }}{{ else }}0{{ end }}"
selector: table tr:nth-child(3) td:nth-child(5) font b:nth-child(2)
optional: true
default: 0
downloadvolumefactor:
text: 0
uploadvolumefactor:
Expand Down
12 changes: 5 additions & 7 deletions src/Jackett.Common/Definitions/muziekfabriek.yml
Expand Up @@ -146,16 +146,14 @@ search:
args: " +01:00" # CET
- name: dateparse
args: "d MMMM yyyy HH:mm:ss zzz"
seeders_optional:
optional: true
selector: td:nth-child(4) table tr:nth-child(3) td:nth-child(5) font b
seeders:
text: "{{ if .Result.seeders_optional }}{{ .Result.seeders_optional }}{{ else }}0{{ end }}"
leechers_optional:
selector: td:nth-child(4) table tr:nth-child(3) td:nth-child(5) font b
optional: true
selector: td:nth-child(4) table tr:nth-child(3) td:nth-child(5) font font b
default: 0
leechers:
text: "{{ if .Result.leechers_optional }}{{ .Result.leechers_optional }}{{ else }}0{{ end }}"
selector: td:nth-child(4) table tr:nth-child(3) td:nth-child(5) font font b
optional: true
default: 0
downloadvolumefactor:
text: 0
uploadvolumefactor:
Expand Down
15 changes: 6 additions & 9 deletions src/Jackett.Common/Definitions/nyaasi.yml
Expand Up @@ -177,21 +177,18 @@ search:
args: " -00:00" # GMT
- name: dateparse
args: "yyyy-MM-dd HH:mm zzz"
seeders_optional:
seeders:
selector: td:nth-child(6):not(:empty)
optional: true
seeders:
text: "{{ if .Result.seeders_optional }}{{ .Result.seeders_optional }}{{ else }}0{{ end }}"
leechers_optional:
default: 0
leechers:
selector: td:nth-child(7):not(:empty)
optional: true
leechers:
text: "{{ if .Result.leechers_optional }}{{ .Result.leechers_optional }}{{ else }}0{{ end }}"
grabs_optional:
default: 0
grabs:
selector: td:nth-child(8):not(:empty)
optional: true
grabs:
text: "{{ if .Result.grabs_optional }}{{ .Result.grabs_optional }}{{ else }}0{{ end }}"
default: 0
downloadvolumefactor:
text: 0
uploadvolumefactor:
Expand Down

0 comments on commit 76e5157

Please sign in to comment.