ptfiles: add freeleech filter #9456

add minimumratio and minimumseedtime
This commit is contained in:
Garfield69 2020-09-14 21:10:50 +12:00
parent ae0e15d184
commit 8528383d74
1 changed files with 20 additions and 10 deletions

View File

@ -47,6 +47,10 @@ settings:
- name: password - name: password
type: password type: password
label: Password label: Password
- name: freeleech
type: checkbox
label: Search freeleech only
default: false
- name: sort - name: sort
type: select type: select
label: Sort requested from site label: Sort requested from site
@ -71,24 +75,26 @@ login:
inputs: inputs:
username: "{{ .Config.username }}" username: "{{ .Config.username }}"
password: "{{ .Config.password }}" password: "{{ .Config.password }}"
force_ssl: "on" force_ssl: on
ssl: "" ssl: ""
error: error:
- selector: "p.error:contains(strong)" - selector: p.error:contains(strong)
test: test:
path: browse.php path: browse.php
search: search:
paths: paths:
# https://ptfiles.net/browse.php?search=tt3612126&incldead=1&title=1 # https://ptfiles.net/browse.php?search=tt3612126&incldead=1&title=1
# https://ptfiles.net/browse.php?free=1&search=&incldead=1&title=0
- path: browse.php - path: browse.php
inputs: inputs:
$raw: "{{ range .Categories }}c{{.}}=1&{{end}}" $raw: "{{ range .Categories }}c{{.}}=1&{{end}}"
search: "{{ if .Query.IMDBID }}{{ .Query.IMDBID }}{{else}}{{ .Keywords }}{{end}}" search: "{{ if .Query.IMDBID }}{{ .Query.IMDBID }}{{ else }}{{ .Keywords }}{{ end }}"
# 0 active 1 both 2 dead 3 needseed # 0 active, 1 both, 2 dead, 3 needseed
incldead: 0 incldead: 0
# 0 title 1 descr 2 both 3 genre # 0 title, 1 descr, 2 both, 3 genre
title: "{{ if .Query.IMDBID }}1{{else}}0{{end}}" title: "{{ if .Query.IMDBID }}1{{ else }}0{{ end }}"
free: "{{ if .Config.freeleech }}1{{ else }}{{ end }}"
sort: "{{ .Config.sort }}" sort: "{{ .Config.sort }}"
type: "{{ .Config.type }}" type: "{{ .Config.type }}"
@ -144,15 +150,19 @@ search:
args: ["Uploaded: ", ""] args: ["Uploaded: ", ""]
downloadvolumefactor: downloadvolumefactor:
case: case:
"span.tool:contains(\"[FREE]\")": "0" "span.tool:contains(\"[FREE]\")": 0
"*": "1" "*": 1
uploadvolumefactor: uploadvolumefactor:
case: text: 1
"*": "1"
description: description:
selector: td:nth-child(2) > span:has(span > small) selector: td:nth-child(2) > span:has(span > small)
remove: span:nth-child(1), span.tool, a[title^="Search all"], br ~ b > small remove: span:nth-child(1), span.tool, a[title^="Search all"], br ~ b > small
filters: filters:
- name: trim - name: trim
args: "/" args: "/"
minimumratio:
text: 1.0
minimumseedtime:
# 2 days (as seconds = 2 x 24 x 60 x 60)
text: 172800
# TBDev Custom # TBDev Custom