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.

eb8c3c3b8c/src/Jackett.Common/Models/ResultPage.cs (L45)

2951fcfc42/src/Jackett.Common/Resources/test.xml
This commit is contained in:
Alex Duchesne 2024-08-06 19:49:54 -04:00
parent dbb42bb48d
commit a175179fed
2 changed files with 9 additions and 2 deletions

View File

@ -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 urllib import request as urllib_request
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 @@ class jackett(object):
# 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):

View File

@ -1,5 +1,5 @@
eztv: 1.14
jackett: 4.0
jackett: 4.1
limetorrents: 4.7
piratebay: 3.3
solidtorrents: 2.2