From 61e2add89a34cdbfe2299ef4803cc9b76195e7af Mon Sep 17 00:00:00 2001 From: kaso17 Date: Sun, 17 Sep 2017 16:32:05 +0200 Subject: [PATCH] 1337x: optional category and conditional date parsing --- src/Jackett/Definitions/1337x.yml | 43 +++++++++++++++++++------------ 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/src/Jackett/Definitions/1337x.yml b/src/Jackett/Definitions/1337x.yml index 0326070df..3ca1d83ef 100644 --- a/src/Jackett/Definitions/1337x.yml +++ b/src/Jackett/Definitions/1337x.yml @@ -111,6 +111,7 @@ title: selector: td[class^="coll-1"] a[href^="/torrent/"] category: + optional: true selector: td[class^="coll-1"] a[href^="/sub/"] attribute: href filters: @@ -128,18 +129,12 @@ # magnet URI is on the details page # selector: td[class^="coll-1"] a[href^="/torrent/"] # attribute: href + # dates come in three flavours: date: - selector: td[class^="coll-date"] + # (within this year) 7am Sep. 14th + optional: true + selector: td[class^="coll-date"]:not(:contains(":")):not(:contains("'")) filters: - # dates come in three flavours: - # (more than a year ago) Apr. 18th '11 - # (within this year) 7am Sep. 14th - # (today) 12:25am - # this code will generate 2 silent errors for each row (visible in enhanced logs). is there a better way? Corrections welcome. - - name: replace - args: ["'", ""] - - name: replace - args: [".", ""] - name: replace args: ["st", ""] - name: replace @@ -148,16 +143,32 @@ args: ["rd", ""] - name: replace args: ["th", ""] + - name: dateparse + args: "3pm Jan. 2" + date: + # (more than a year ago) Apr. 18th '11 + optional: true + selector: td[class^="coll-date"]:contains("'") + filters: - name: replace - args: ["am", ""] + args: ["'", ""] - name: replace - args: ["pm", ""] + args: ["st", ""] + - name: replace + args: ["nd", ""] + - name: replace + args: ["rd", ""] + - name: replace + args: ["th", ""] - name: dateparse - args: "MMM d y" + args: "Jan. 2 06" + date: + # # (today) 12:25am + optional: true + selector: td[class^="coll-date"]:contains(":") + filters: - name: dateparse - args: "h MMM d" - - name: dateparse - args: "h:mm" + args: "3:04pm" size: selector: td[class^="coll-4"] seeders: