1
0
mirror of https://github.com/searxng/searxng.git synced 2024-10-01 09:00:15 +02:00

[enh] magnet link added

This commit is contained in:
asciimoo 2013-10-22 19:15:41 +02:00
parent ef7e1199c3
commit ea03aaecb4

View File

@ -32,5 +32,7 @@ def response(resp):
content = escape(' '.join(result.xpath('.//font[@class="detDesc"]//text()'))) content = escape(' '.join(result.xpath('.//font[@class="detDesc"]//text()')))
seed, leech = result.xpath('.//td[@align="right"]/text()')[:2] seed, leech = result.xpath('.//td[@align="right"]/text()')[:2]
content += '<br />Seed: %s, Leech: %s' % (seed, leech) 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(base_url, magnetlink.attrib['href'])
results.append({'url': url, 'title': title, 'content': content}) results.append({'url': url, 'title': title, 'content': content})
return results return results