summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2020-08-11 14:56:19 +0200
committerGitHub <noreply@github.com>2020-08-11 14:56:19 +0200
commit093dd42bb05feafb2cc77304d3b1a9a1a3016949 (patch)
tree14bef64083342037fda6c120609d34c258368619
parentf3bfc4f4a97c730b169e9645fd8db98d71adbeec (diff)
parentc15a91a534ccdcb395f13782cb3655b314d6a58e (diff)
downloadsearxng-093dd42bb05feafb2cc77304d3b1a9a1a3016949.tar.gz
searxng-093dd42bb05feafb2cc77304d3b1a9a1a3016949.zip
Merge pull request #2134 from unixfox/fix/piratebay-engine-date-indentation
[fix] piratebay engine date and pep8 indentation
-rw-r--r--searx/engines/piratebay.py6
1 files 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