forked from Ponysearch/Ponysearch
[enh] highlight piratebay results with light grey border, and indent peers+magnet link
This commit is contained in:
parent
74ca542a02
commit
b0a4404217
2 changed files with 10 additions and 3 deletions
|
@ -28,8 +28,8 @@ def response(resp):
|
|||
title = ' '.join(link.xpath('.//text()'))
|
||||
content = escape(' '.join(result.xpath('.//font[@class="detDesc"]//text()')))
|
||||
seed, leech = result.xpath('.//td[@align="right"]/text()')[:2]
|
||||
content += '<br />Seed: %s, Leech: %s' % (seed, leech)
|
||||
magnetlink = result.xpath('.//a[@title="Download this torrent using magnet"]')[0]
|
||||
content += '<br /><a href="%s">magnet link</a>' % urljoin(url, magnetlink.attrib['href'])
|
||||
results.append({'url': href, 'title': title, 'content': content})
|
||||
results.append({'url': href, 'title': title, 'content': content,
|
||||
'seed': seed, 'leech': leech, 'magnetlink': magnetlink.attrib['href'],
|
||||
'template': 'torrent.html'})
|
||||
return results
|
||||
|
|
7
searx/templates/result_templates/torrent.html
Normal file
7
searx/templates/result_templates/torrent.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<div class="result torrent_result">
|
||||
<h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
|
||||
<p class="content">{% if result.content %}{{ result.content|safe }}<br />{% endif %}</p>
|
||||
<p class="stats">Seed: {{ result.seed }}, Leech: {{ result.leech }}</p>
|
||||
<p><a href="{{ result.magnetlink }}" class="magnetlink">magnet link</a></p>
|
||||
<p class="url">{{ result.pretty_url }}</p>
|
||||
</div>
|
Loading…
Reference in a new issue