From a175179feddbc080d0e97654539ef6cc2eef6dbe Mon Sep 17 00:00:00 2001 From: Alex Duchesne Date: Tue, 6 Aug 2024 19:49:54 -0400 Subject: [PATCH] Added date field support to Jackett This is untested as I can't install Jackett to test right now. I went based on Jackett's code because the API they've linked to doesn't really talk about dates. https://github.com/Jackett/Jackett/blob/eb8c3c3b8cdb1cd4fbb8d43a0af7c6b2b0bd2450/src/Jackett.Common/Models/ResultPage.cs#L45 https://github.com/Jackett/Jackett/blob/2951fcfc42865ea51bf1aaf33f8882c794a6bd70/src/Jackett.Common/Resources/test.xml --- nova3/engines/jackett.py | 9 ++++++++- nova3/engines/versions.txt | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/nova3/engines/jackett.py b/nova3/engines/jackett.py index 291ac7d..5905364 100644 --- a/nova3/engines/jackett.py +++ b/nova3/engines/jackett.py @@ -1,4 +1,4 @@ -#VERSION: 4.0 +#VERSION: 4.1 # AUTHORS: Diego de las Heras (ngosang@hotmail.es) # CONTRIBUTORS: ukharley # hannsen (github.com/hannsen) @@ -12,6 +12,7 @@ from http.cookiejar import CookieJar from multiprocessing.dummy import Pool from threading import Lock +from datetime import datetime from novaprinter import prettyPrinter from helpers import download_file @@ -197,6 +198,12 @@ def search_jackett_indexer(self, what, category, indexer_id): # note: engine_url can't be changed, torrent download stops working res['engine_url'] = self.url + try: + date = datetime.strptime(result.find('pubDate').text, '%a, %d %b %Y %H:%M:%S %z') + res['pub_date'] = int(date.timestamp()) + except Exception: + res['pub_date'] = -1 + self.pretty_printer_thread_safe(res) def generate_xpath(self, tag): diff --git a/nova3/engines/versions.txt b/nova3/engines/versions.txt index fd9913f..dc5f186 100644 --- a/nova3/engines/versions.txt +++ b/nova3/engines/versions.txt @@ -1,5 +1,5 @@ eztv: 1.14 -jackett: 4.0 +jackett: 4.1 limetorrents: 4.7 piratebay: 3.3 solidtorrents: 2.2