diff options
-rw-r--r-- | searx/engines/acgsou.py | 74 | ||||
-rw-r--r-- | searx/engines/yahoo_news.py | 7 | ||||
-rw-r--r-- | searx/settings.yml | 12 |
3 files changed, 6 insertions, 87 deletions
diff --git a/searx/engines/acgsou.py b/searx/engines/acgsou.py deleted file mode 100644 index ea9793f10..000000000 --- a/searx/engines/acgsou.py +++ /dev/null @@ -1,74 +0,0 @@ -# SPDX-License-Identifier: AGPL-3.0-or-later -""" - Acgsou (Japanese Animation/Music/Comics Bittorrent tracker) -""" - -from urllib.parse import urlencode -from lxml import html -from searx.utils import extract_text, get_torrent_size, eval_xpath_list, eval_xpath_getindex - -# about -about = { - "website": 'https://www.acgsou.com/', - "wikidata_id": None, - "official_api_documentation": None, - "use_official_api": False, - "require_api_key": False, - "results": 'HTML', -} - -# engine dependent config -categories = ['files', 'images', 'videos', 'music'] -paging = True - -# search-url -base_url = 'https://www.acgsou.com/' -search_url = base_url + 'search.php?{query}&page={offset}' -# xpath queries -xpath_results = '//table[contains(@class, "list_style table_fixed")]//tr[not(th)]' -xpath_category = './/td[2]/a[1]' -xpath_title = './/td[3]/a[last()]' -xpath_torrent_links = './/td[3]/a' -xpath_filesize = './/td[4]/text()' - - -def request(query, params): - query = urlencode({'keyword': query}) - params['url'] = search_url.format(query=query, offset=params['pageno']) - return params - - -def response(resp): - results = [] - dom = html.fromstring(resp.text) - for result in eval_xpath_list(dom, xpath_results): - # defaults - filesize = 0 - magnet_link = "magnet:?xt=urn:btih:{}&tr=https://tracker.acgsou.com:2710/announce" - - category = extract_text(eval_xpath_getindex(result, xpath_category, 0, default=[])) - page_a = eval_xpath_getindex(result, xpath_title, 0) - title = extract_text(page_a) - href = base_url + page_a.attrib.get('href') - - magnet_link = magnet_link.format(page_a.attrib.get('href')[5:-5]) - - filesize_info = eval_xpath_getindex(result, xpath_filesize, 0, default=None) - if filesize_info: - try: - filesize = filesize_info[:-2] - filesize_multiplier = filesize_info[-2:] - filesize = get_torrent_size(filesize, filesize_multiplier) - except: - pass - # I didn't add download/seed/leech count since as I figured out they are generated randomly everytime - content = 'Category: "{category}".' - content = content.format(category=category) - - results.append({'url': href, - 'title': title, - 'content': content, - 'filesize': filesize, - 'magnetlink': magnet_link, - 'template': 'torrent.html'}) - return results diff --git a/searx/engines/yahoo_news.py b/searx/engines/yahoo_news.py index 5f6734cb3..49b3d1bf8 100644 --- a/searx/engines/yahoo_news.py +++ b/searx/engines/yahoo_news.py @@ -22,13 +22,6 @@ from searx.utils import ( from searx.engines.yahoo import parse_url -# pylint: disable=unused-import -from searx.engines.yahoo import ( - _fetch_supported_languages, - supported_languages_url, -) -# pylint: enable=unused-import - logger = logger.getChild('yahoo_news engine') # about diff --git a/searx/settings.yml b/searx/settings.yml index da84e82b5..a8d625b05 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -82,6 +82,8 @@ outgoing: # communication with search engines # https: # - http://proxy1:8080 # - http://proxy2:8080 +# using_tor_proxy : True +# extra_proxy_timeout : 10.0 # Extra seconds to add in order to account for the time taken by the proxy # uncomment below section only if you have more than one network interface # which can be the source of outgoing search requests # source_ips: @@ -159,6 +161,7 @@ engines: - name : ahmia engine : ahmia categories : onions + enable_http : True shortcut : ah - name : arch linux wiki @@ -730,6 +733,8 @@ engines: # Requires Tor - name : not evil engine : not_evil + categories : onions + enable_http : True shortcut : ne - name : nyaa @@ -737,12 +742,6 @@ engines: shortcut : nt disabled : True - - name : acgsou - engine : acgsou - shortcut : acg - disabled : True - timeout: 5.0 - - name : openairedatasets engine : json_engine paging : True @@ -990,6 +989,7 @@ engines: title_xpath : ./td[2]/b content_xpath : ./td[2]/small categories : onions + enable_http : True shortcut : tch # maybe in a fun category |