From 80044c656e2d52f083390f910e63ff7e82a1a9a7 Mon Sep 17 00:00:00 2001 From: Garfield69 Date: Sun, 2 Jul 2023 20:14:25 +1200 Subject: [PATCH] torrentproject: add latest for keywordless instead of search for .Today.Year --- .../Definitions/torrentproject2.yml | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/src/Jackett.Common/Definitions/torrentproject2.yml b/src/Jackett.Common/Definitions/torrentproject2.yml index 9ca0b8207..9b2e20f11 100644 --- a/src/Jackett.Common/Definitions/torrentproject2.yml +++ b/src/Jackett.Common/Definitions/torrentproject2.yml @@ -60,14 +60,15 @@ download: search: paths: - - path: / - - path: / + # browse for latest, / for keywords, 50 rows per page + - path: "{{ if .Keywords }}/{{ else }}browse{{ end }}" + - path: "{{ if .Keywords }}/{{ else }}browse{{ end }}" inputs: p: 1 inputs: - t: "{{ if .Keywords }}{{ .Keywords }}{{ else }}{{ .Today.Year }}{{ end }}" - orderby: "{{ .Config.sort }}" - safe: "{{ if .Config.filter-verified }}on{{ else }}{{ end }}" + t: "{{ .Keywords }}" + orderby: "{{ if .Keywords }}{{ .Config.sort }}{{ else }}{{ end }}" + safe: "{{ if and .Keywords .Config.filter-verified }}on{{ else }}{{ end }}" keywordsfilters: - name: re_replace args: [" ", "+"] @@ -77,6 +78,7 @@ search: fields: category: + # while browse has cats the search does not (atm) so we wont support cats for now. text: Other title: selector: span > a @@ -86,9 +88,21 @@ search: download: selector: span > a attribute: href - date: + date_ago: # 7 years ago - selector: span:nth-child(4) + selector: span:nth-child(4):contains("ago") + optional: true + date_time: + # 2020-11-05 07:34:44 + selector: span:nth-child(4):contains(":") + optional: true + filters: + - name: append + args: " -07:00" # PDT + - name: dateparse + args: "yyyy-MM-dd HH:mm:ss zzz" + date: + text: "{{ if or .Result.date_ago .Result.date_time }}{{ or .Result.date_ago .Result.date_time }}{{ else }}now{{ end }}" size: selector: span:nth-child(5) seeders: