1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-22 20:17:45 +01:00

Merge pull request #2134 from unixfox/fix/piratebay-engine-date-indentation

[fix] piratebay engine date and pep8 indentation
This commit is contained in:
Alexandre Flament 2020-08-11 14:56:19 +02:00 committed by GitHub
commit 093dd42bb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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