From 6444617554fd433757c916af3e08d90a22d942bb Mon Sep 17 00:00:00 2001 From: Garfield69 Date: Fri, 18 Nov 2022 15:35:18 +1300 Subject: [PATCH] pixelcove: fix date parse. resolves #13726 --- src/Jackett.Common/Definitions/pixelcove.yml | 19 ++++++++++++++++--- .../Definitions/pixelcove2fa.yml | 19 ++++++++++++++++--- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/Jackett.Common/Definitions/pixelcove.yml b/src/Jackett.Common/Definitions/pixelcove.yml index d43de2b4d..52dde1576 100644 --- a/src/Jackett.Common/Definitions/pixelcove.yml +++ b/src/Jackett.Common/Definitions/pixelcove.yml @@ -151,14 +151,27 @@ search: args: ["/static/common/noartwork/noimage.png", ""] files: selector: td:nth-child(3) - date: - selector: td:nth-child(5) > span - attribute: title + date_elapsed: + # Oct 01 2022, 18:41 + selector: td:nth-child(5) > span:not(:contains("ago")) + optional: true filters: - name: append args: " +00:00" # auto adjusted by site account profile - name: dateparse args: "Jan 02 2006, 15:04 -07:00" + date_added: + # 13 hours ago + selector: td:nth-child(5) > span:contains("ago") + attribute: title + optional: true + filters: + - name: append + args: " +00:00" # auto adjusted by site account profile + - name: dateparse + args: "Jan 02 2006, 15:04 -07:00" + date: + text: "{{ if or .Result.date_elapsed .Result.date_added }}{{ or .Result.date_elapsed .Result.date_added }}{{ else }}now{{ end }}" size: selector: td:nth-child(6) grabs: diff --git a/src/Jackett.Common/Definitions/pixelcove2fa.yml b/src/Jackett.Common/Definitions/pixelcove2fa.yml index 4ac82614b..1f93622a4 100644 --- a/src/Jackett.Common/Definitions/pixelcove2fa.yml +++ b/src/Jackett.Common/Definitions/pixelcove2fa.yml @@ -146,14 +146,27 @@ search: args: ["/static/common/noartwork/noimage.png", ""] files: selector: td:nth-child(3) - date: - selector: td:nth-child(5) > span - attribute: title + date_elapsed: + # Oct 01 2022, 18:41 + selector: td:nth-child(5) > span:not(:contains("ago")) + optional: true filters: - name: append args: " +00:00" # auto adjusted by site account profile - name: dateparse args: "Jan 02 2006, 15:04 -07:00" + date_added: + # 13 hours ago + selector: td:nth-child(5) > span:contains("ago") + attribute: title + optional: true + filters: + - name: append + args: " +00:00" # auto adjusted by site account profile + - name: dateparse + args: "Jan 02 2006, 15:04 -07:00" + date: + text: "{{ if or .Result.date_elapsed .Result.date_added }}{{ or .Result.date_elapsed .Result.date_added }}{{ else }}now{{ end }}" size: selector: td:nth-child(6) grabs: