torlock, torrentdownloads: freeleech. resolves #6599

torlock: add config sort option.
This commit is contained in:
Garfield69 2019-12-14 09:54:14 +13:00
parent 4fb6a4f28d
commit fc360a9770
2 changed files with 27 additions and 9 deletions

View File

@ -30,11 +30,26 @@
tv-search: [q, season, ep] tv-search: [q, season, ep]
movie-search: [q] movie-search: [q]
settings: [] settings:
- name: sort
type: select
label: Sort requested from site (only works for search with keywords)
default: "added"
options:
"added": "created"
"seeds": "seeders"
"size": "size"
- name: type
type: select
label: Order requested from site
default: "desc"
options:
"desc": "desc"
"asc": "asc"
search: search:
paths: paths:
- path: "{{if .Keywords}}/all/torrents/{{ .Keywords }}.html{{else}}/fresh.html{{end}}" - path: "{{if .Keywords}}/all/torrents/{{ .Keywords }}.html?sort={{ .Config.sort }}&order={{ .Config.type }}{{else}}/fresh.html{{end}}"
# - path: "{{if .Keywords}}/television/torrents/{{ .Keywords }}.html{{else}}/television/1/added/desc.html{{end}}" # - path: "{{if .Keywords}}/television/torrents/{{ .Keywords }}.html{{else}}/television/1/added/desc.html{{end}}"
# categorymappings: [TELEVISION] # categorymappings: [TELEVISION]
# - path: "{{if .Keywords}}/movies/torrents/{{ .Keywords }}.html{{else}}/movies/1/added/desc.html{{end}}" # - path: "{{if .Keywords}}/movies/torrents/{{ .Keywords }}.html{{else}}/movies/1/added/desc.html{{end}}"
@ -61,10 +76,12 @@
- name: tolower - name: tolower
- name: re_replace - name: re_replace
args: ["[^a-zA-Z0-9]+", "-"] args: ["[^a-zA-Z0-9]+", "-"]
rows: rows:
selector: table > tbody > tr:has(td:has(div:has(a[href^="/torrent/"]))) selector: table > tbody > tr:has(td:has(div:has(a[href^="/torrent/"])))
filters: filters:
- name: andmatch - name: andmatch
fields: fields:
title: title:
selector: td:nth-child(1) > div > a selector: td:nth-child(1) > div > a
@ -109,6 +126,6 @@
span.tv12: AUDIOBOOK span.tv12: AUDIOBOOK
"*": "" # some torrents have invalid categories "*": "" # some torrents have invalid categories
downloadvolumefactor: downloadvolumefactor:
text: "1" text: 0
uploadvolumefactor: uploadvolumefactor:
text: "1" text: 1

View File

@ -34,7 +34,6 @@
"http://itorrents.org/" : "iTorrents.org" "http://itorrents.org/" : "iTorrents.org"
"magnet:": "magnet" "magnet:": "magnet"
download: download:
selector: a[href^="{{ .Config.downloadlink }}"] selector: a[href^="{{ .Config.downloadlink }}"]
@ -44,8 +43,10 @@
inputs: inputs:
$raw: "new=1&{{range .Categories}}s_cat={{.}}&{{end}}" $raw: "new=1&{{range .Categories}}s_cat={{.}}&{{end}}"
search: "{{ .Keywords }}" search: "{{ .Keywords }}"
rows: rows:
selector: div.inner_container > div:has(p:has(a[href^="/torrent/"])) selector: div.inner_container > div:has(p:has(a[href^="/torrent/"]))
fields: fields:
title: title:
selector: p:nth-child(1) > a selector: p:nth-child(1) > a
@ -70,6 +71,6 @@
- name: regexp - name: regexp
args: ([\d,]+) args: ([\d,]+)
downloadvolumefactor: downloadvolumefactor:
text: "1" text: 0
uploadvolumefactor: uploadvolumefactor:
text: "1" text: 1