From c15a91a534ccdcb395f13782cb3655b314d6a58e Mon Sep 17 00:00:00 2001 From: Emilien Devos Date: Mon, 10 Aug 2020 23:44:53 +0200 Subject: [PATCH] [fix] piratebay engine date and pep8 indentation --- searx/engines/piratebay.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/searx/engines/piratebay.py b/searx/engines/piratebay.py index e84a40d3f..0122d6daa 100644 --- a/searx/engines/piratebay.py +++ b/searx/engines/piratebay.py @@ -62,8 +62,8 @@ def response(resp): # parse results for result in search_res: link = url + "description.php?id=" + result["id"] - magnetlink = "magnet:?xt=urn:btih:" + result["info_hash"] + "&dn=" + result["name"] - + "&tr=" + "&tr=".join(trackers) + magnetlink = "magnet:?xt=urn:btih:" + result["info_hash"] + \ + "&dn=" + result["name"] + "&tr=" + "&tr=".join(trackers) params = { "url": link, @@ -76,7 +76,7 @@ def response(resp): # extract and convert creation date try: - date = datetime.fromtimestamp(result.added) + date = datetime.fromtimestamp(float(result["added"])) params['publishedDate'] = date except: pass