SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
update generalfile engine and add comments
Thomas Pointhuberc5d83059d537
diff --git a/searx/engines/generalfile.py b/searx/engines/generalfile.pyindex d249c00c7..11d8b6955 100644--- a/searx/engines/generalfile.py+++ b/searx/engines/generalfile.py@@ -1,35 +1,60 @@+## General Files (Files)+#+# @website http://www.general-files.org+# @provide-api no (nothing found)+#+# @using-api no (because nothing found)+# @results HTML (using search portal)+# @stable no (HTML can change)+# @parse url, title, content+#+# @todo detect torrents?+from lxml import html+# engine dependent config+categories = ['files']+paging = True+# search-urlbase_url = 'http://www.general-file.com'search_url = base_url + '/files-{letter}/{query}/{pageno}'+# specific xpath variablesresult_xpath = '//table[@class="block-file"]'title_xpath = './/h2/a//text()'url_xpath = './/h2/a/@href'content_xpath = './/p//text()'-paging = True-+# do search-requestdef request(query, params):+params['url'] = search_url.format(query=query,letter=query[0],pageno=params['pageno'])+return params+# get response from search-requestdef response(resp):-results = []+dom = html.fromstring(resp.text)++ # parse resultsfor result in dom.xpath(result_xpath):url = result.xpath(url_xpath)[0]+# skip fast download linksif not url.startswith('/'):continue++ # append resultresults.append({'url': base_url + url,'title': ''.join(result.xpath(title_xpath)),'content': ''.join(result.xpath(content_xpath))})+ # return resultsreturn resultsdiff --git a/searx/settings.yml b/searx/settings.ymlindex 5a9254070..c6227212e 100644--- a/searx/settings.yml+++ b/searx/settings.yml@@ -62,7 +62,6 @@ engines:- name : general-fileengine : generalfile- categories : filesshortcut : gf- name : github