59 search_res = loads(resp.text)
62 if search_res[0][
"name"] ==
"No results returned":
66 for result
in search_res:
67 link = url +
"description.php?id=" + result[
"id"]
69 "magnet:?xt=urn:btih:" + result[
"info_hash"] +
"&dn=" + result[
"name"] +
"&tr=" +
"&tr=".join(trackers)
74 "title": result[
"name"],
75 "seed": result[
"seeders"],
76 "leech": result[
"leechers"],
77 "magnetlink": magnetlink,
78 "template":
"torrent.html",
83 params[
'publishedDate'] = datetime.fromtimestamp(float(result[
"added"]))
88 params[
'filesize'] = humanize_bytes(int(result[
"size"]))
91 results.append(params)
94 return sorted(results, key=itemgetter(
"seed"), reverse=
True)