casatorrent: add config multi option. #9544 and add freeleech filter #9456

untested
This commit is contained in:
Garfield69 2020-09-19 14:03:11 +12:00
parent f781d6d4ff
commit 471f95b73c
1 changed files with 43 additions and 5 deletions

View File

@ -77,6 +77,29 @@ settings:
- name: password
type: password
label: Password
- name: freeleech
type: checkbox
label: Search freeleech only
default: false
- name: multilang
type: checkbox
label: Replace MULTI by another language in release name
default: false
- name: multilanguage
type: select
label: Replace MULTI by this language
default: FRENCH
options:
FRENCH: "FRENCH"
MULTI.FRENCH: "MULTI.FRENCH"
ENGLISH: "ENGLISH"
MULTI.ENGLISH: "MULTI.ENGLISH"
VOSTFR: "VOSTFR"
MULTI.VOSTFR: "MULTI.VOSTFR"
- name: vostfr
type: checkbox
label: Replace VOSTFR with ENGLISH
default: false
- name: sort
type: select
label: Sort requested from site
@ -117,7 +140,7 @@ search:
$raw: "{{ range .Categories }}c{{.}}=1&{{end}}"
search: "{{ .Keywords }}"
incldead: 1
freeleech: 0
freeleech: "{{ if .Config.freeleech }}1{{ else }}0{{ end }}"
lang: 0
sort: "{{ .Config.sort }}"
order: "{{ .Config.type }}"
@ -129,14 +152,30 @@ search:
selector: table.ttable_headinner > tbody > tr.t-row
fields:
title:
selector: a[href^="torrents-details.php?id="] b
category:
selector: a[href^="torrents.php?cat="]
attribute: href
filters:
- name: querystring
args: cat
title_phase1:
selector: a[href^="torrents-details.php?id="] b
title_multilang:
text: "{{ .Result.title_phase1 }}"
filters:
- name: re_replace
args: ["(?i)(\\smulti\\s)", " {{ .Config.multilanguage }} "]
title_phase2:
text: "{{ if .Config.multilang }}{{ .Result.title_multilang }}{{ else }}{{ .Result.title_phase1 }}{{ end }}"
title_vostfr:
text: "{{ .Result.title_phase2 }}"
filters:
- name: re_replace
args: ["(?i)(\\svostfr\\s)", " ENGLISH "]
- name: re_replace
args: ["(?i)(\\ssubfrench\\s)", " ENGLISH "]
title:
text: "{{ if .Config.vostfr }}{{ .Result.title_vostfr }}{{ else }}{{ .Result.title_phase2 }}{{ end }}"
details:
selector: a[href^="torrents-details.php?id="]
attribute: href
@ -171,6 +210,5 @@ search:
img[src="images/free.gif"]: 0
"*": 1
uploadvolumefactor:
case:
"*": 1
text: 1
# engine n/a