From fc360a97703c5c7a185bd9c707e6b6e4985734bf Mon Sep 17 00:00:00 2001 From: Garfield69 Date: Sat, 14 Dec 2019 09:54:14 +1300 Subject: [PATCH] torlock, torrentdownloads: freeleech. resolves #6599 torlock: add config sort option. --- src/Jackett.Common/Definitions/torlock.yml | 25 ++++++++++++++++--- .../Definitions/torrentdownloads.yml | 11 ++++---- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/Jackett.Common/Definitions/torlock.yml b/src/Jackett.Common/Definitions/torlock.yml index 52af2ee5c..ceca6f7dd 100644 --- a/src/Jackett.Common/Definitions/torlock.yml +++ b/src/Jackett.Common/Definitions/torlock.yml @@ -30,11 +30,26 @@ tv-search: [q, season, ep] 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: 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}}" # categorymappings: [TELEVISION] # - path: "{{if .Keywords}}/movies/torrents/{{ .Keywords }}.html{{else}}/movies/1/added/desc.html{{end}}" @@ -61,10 +76,12 @@ - name: tolower - name: re_replace args: ["[^a-zA-Z0-9]+", "-"] + rows: selector: table > tbody > tr:has(td:has(div:has(a[href^="/torrent/"]))) filters: - name: andmatch + fields: title: selector: td:nth-child(1) > div > a @@ -109,6 +126,6 @@ span.tv12: AUDIOBOOK "*": "" # some torrents have invalid categories downloadvolumefactor: - text: "1" + text: 0 uploadvolumefactor: - text: "1" + text: 1 diff --git a/src/Jackett.Common/Definitions/torrentdownloads.yml b/src/Jackett.Common/Definitions/torrentdownloads.yml index 18dcab175..c6b0f2564 100644 --- a/src/Jackett.Common/Definitions/torrentdownloads.yml +++ b/src/Jackett.Common/Definitions/torrentdownloads.yml @@ -24,7 +24,7 @@ search: [q] tv-search: [q, season, ep] movie-search: [q] - + settings: - name: downloadlink type: select @@ -34,18 +34,19 @@ "http://itorrents.org/" : "iTorrents.org" "magnet:": "magnet" - download: selector: a[href^="{{ .Config.downloadlink }}"] - + search: paths: - path: "{{if .Keywords}}/search/{{else}}/today/{{end}}" inputs: $raw: "new=1&{{range .Categories}}s_cat={{.}}&{{end}}" search: "{{ .Keywords }}" + rows: selector: div.inner_container > div:has(p:has(a[href^="/torrent/"])) + fields: title: selector: p:nth-child(1) > a @@ -70,6 +71,6 @@ - name: regexp args: ([\d,]+) downloadvolumefactor: - text: "1" + text: 0 uploadvolumefactor: - text: "1" + text: 1