@@ -9,7 +9,6 @@
9 @parse url, title, content, seed, leech, torrentfile
9 @parse url, title, content, seed, leech, torrentfile
12−from cgi import escape
13from urllib import urlencode
12from urllib import urlencode
14from lxml import html
13from lxml import html
15from searx.engines.xpath import extract_text
14from searx.engines.xpath import extract_text
@@ -78,7 +77,7 @@ def response(resp):
79 # torrent title
78 # torrent title
80 page_a = result.xpath(xpath_title)[0]
79 page_a = result.xpath(xpath_title)[0]
81− title = escape(extract_text(page_a))
80+ title = extract_text(page_a)
83 # link to the page
82 # link to the page
84 href = page_a.attrib.get('href')
83 href = page_a.attrib.get('href')
@@ -90,7 +89,7 @@ def response(resp):
91 file_size, suffix = result.xpath(xpath_filesize)[0].split(' ')
90 file_size, suffix = result.xpath(xpath_filesize)[0].split(' ')
92 file_size = int(float(file_size) * get_filesize_mul(suffix))
91 file_size = int(float(file_size) * get_filesize_mul(suffix))
93− except Exception as e:
92+ except:
94 file_size = None
93 file_size = None
96 # seed count
95 # seed count
@@ -105,7 +104,6 @@ def response(resp):
105 # content string contains all information not included into template
104 # content string contains all information not included into template
106 content = 'Category: "{category}". Downloaded {downloads} times.'
105 content = 'Category: "{category}". Downloaded {downloads} times.'
107 content = content.format(category=category, downloads=downloads)
106 content = content.format(category=category, downloads=downloads)
108− content = escape(content)
110 results.append({'url': href,
108 results.append({'url': href,
111 'title': title,
109 'title': title,