Преглед на файлове

[enh] magnet link added

asciimoo преди 11 години
родител
ревизия
ea03aaecb4
променени са 1 файла, в които са добавени 2 реда и са изтрити 0 реда
  1. 2
    0
      searx/engines/piratebay.py

+ 2
- 0
searx/engines/piratebay.py Целия файл

@@ -32,5 +32,7 @@ def response(resp):
32 32
         content = escape(' '.join(result.xpath('.//font[@class="detDesc"]//text()')))
33 33
         seed, leech = result.xpath('.//td[@align="right"]/text()')[:2]
34 34
         content += '<br />Seed: %s, Leech: %s' % (seed, leech)
35
+        magnetlink = result.xpath('.//a[@title="Download this torrent using magnet"]')[0]
36
+        content += '<br /><a href="%s">magnet link</a>' % urljoin(base_url, magnetlink.attrib['href'])
35 37
         results.append({'url': url, 'title': title, 'content': content})
36 38
     return results