@@ -1,67 +0,0 @@
1−# SPDX-License-Identifier: AGPL-3.0-or-later
6−from urllib.parse import urlencode
8−from searx.engines.xpath import extract_text
12− "website": 'http://hss3uro2hsxfogfq.onion',
14− "official_api_documentation": 'http://hss3uro2hsxfogfq.onion/api.htm',
15− "use_official_api": False,
16− "require_api_key": False,
20−# engine dependent config
21−categories = ['onions']
26−base_url = 'http://hss3uro2hsxfogfq.onion/'
27−search_url = 'index.php?{query}&hostLimit=20&start={pageno}&numRows={page_size}'
29−# specific xpath variables
30−results_xpath = '//*[@id="content"]/div/p'
31−url_xpath = './span[1]'
32−title_xpath = './a[1]'
33−content_xpath = './text()'
37−def request(query, params):
38− offset = (params['pageno'] - 1) * page_size
40− params['url'] = base_url + search_url.format(pageno=offset,
41− query=urlencode({'q': query}),
47−# get response from search-request
51− # needed because otherwise requests guesses wrong encoding
52− resp.encoding = 'utf8'
53− dom = html.fromstring(resp.text)
56− for result in dom.xpath(results_xpath):
57− url = extract_text(result.xpath(url_xpath)[0])
58− title = extract_text(result.xpath(title_xpath)[0])
59− content = extract_text(result.xpath(content_xpath))
62− results.append({'url': url,