Skip to content

Commit 0f6f0b9

Browse files
committed
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
1 parent dbb42bb commit 0f6f0b9

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

nova3/engines/jackett.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#VERSION: 4.0
1+
#VERSION: 4.1
22
# AUTHORS: Diego de las Heras ([email protected])
33
# CONTRIBUTORS: ukharley
44
# hannsen (github.com/hannsen)
@@ -12,6 +12,7 @@
1212
from http.cookiejar import CookieJar
1313
from multiprocessing.dummy import Pool
1414
from threading import Lock
15+
from datetime import datetime
1516

1617
from novaprinter import prettyPrinter
1718
from helpers import download_file
@@ -197,6 +198,12 @@ def search_jackett_indexer(self, what, category, indexer_id):
197198
# note: engine_url can't be changed, torrent download stops working
198199
res['engine_url'] = self.url
199200

201+
try:
202+
date = datetime.strptime(result.find('pubDate').text, '%a, %d %b %Y %H:%M:%S %z')
203+
res['pub_date'] = int(date.timestamp())
204+
except:
205+
res['pub_date'] = -1
206+
200207
self.pretty_printer_thread_safe(res)
201208

202209
def generate_xpath(self, tag):

nova3/engines/versions.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
eztv: 1.14
2-
jackett: 4.0
2+
jackett: 4.1
33
limetorrents: 4.7
44
piratebay: 3.3
55
solidtorrents: 2.2

0 commit comments

Comments
 (0)