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
[mod] tokyotoshokan dependecy to other engine removed
misnyo1e2b60f3805a
diff --git a/searx/engines/tokyotoshokan.py b/searx/engines/tokyotoshokan.pyindex 9a6b5e57d..dfd2e7790 100644--- a/searx/engines/tokyotoshokan.py+++ b/searx/engines/tokyotoshokan.py@@ -14,8 +14,8 @@ import refrom lxml import htmlfrom searx.engines.xpath import extract_textfrom datetime import datetime-from searx.engines.nyaa import int_or_zero, get_filesize_mulfrom searx.url_utils import urlencode+from searx.utils import get_torrent_size# engine dependent configcategories = ['files', 'videos', 'music']@@ -26,6 +26,17 @@ base_url = 'https://www.tokyotosho.info/'search_url = base_url + 'search.php?{query}'+# convert a variable to integer or return 0 if it's not a number+def int_or_zero(num):+ if isinstance(num, list):+ if len(num) < 1:+ return 0+ num = num[0]+ if num.isdigit():+ return int(num)+ return 0++# do search-requestdef request(query, params):query = urlencode({'page': params['pageno'], 'terms': query})@@ -76,8 +87,7 @@ def response(resp):try:# ('1.228', 'GB')groups = size_re.match(item).groups()- multiplier = get_filesize_mul(groups[1])- params['filesize'] = int(multiplier * float(groups[0]))+ params['filesize'] = get_torrent_size(groups[0], groups[1])except:passelif item.startswith('Date:'):