mirror of
https://github.com/searxng/searxng.git
synced 2024-11-19 02:40:11 +01:00
[fix] piratebay engine date and pep8 indentation
This commit is contained in:
parent
f3bfc4f4a9
commit
c15a91a534
@ -62,8 +62,8 @@ def response(resp):
|
|||||||
# parse results
|
# parse results
|
||||||
for result in search_res:
|
for result in search_res:
|
||||||
link = url + "description.php?id=" + result["id"]
|
link = url + "description.php?id=" + result["id"]
|
||||||
magnetlink = "magnet:?xt=urn:btih:" + result["info_hash"] + "&dn=" + result["name"]
|
magnetlink = "magnet:?xt=urn:btih:" + result["info_hash"] + \
|
||||||
+ "&tr=" + "&tr=".join(trackers)
|
"&dn=" + result["name"] + "&tr=" + "&tr=".join(trackers)
|
||||||
|
|
||||||
params = {
|
params = {
|
||||||
"url": link,
|
"url": link,
|
||||||
@ -76,7 +76,7 @@ def response(resp):
|
|||||||
|
|
||||||
# extract and convert creation date
|
# extract and convert creation date
|
||||||
try:
|
try:
|
||||||
date = datetime.fromtimestamp(result.added)
|
date = datetime.fromtimestamp(float(result["added"]))
|
||||||
params['publishedDate'] = date
|
params['publishedDate'] = date
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user