summaryrefslogtreecommitdiff
path: root/searx/engines
diff options
context:
space:
mode:
Diffstat (limited to 'searx/engines')
-rw-r--r--searx/engines/archlinux.py2
-rw-r--r--searx/engines/arxiv.py2
-rwxr-xr-xsearx/engines/base.py2
-rw-r--r--searx/engines/bing.py2
-rw-r--r--searx/engines/currency_convert.py4
-rw-r--r--searx/engines/dictzone.py4
-rw-r--r--searx/engines/gentoo.py2
-rw-r--r--searx/engines/openstreetmap.py4
-rw-r--r--searx/engines/scanr_structures.py2
-rw-r--r--searx/engines/translated.py6
10 files changed, 15 insertions, 15 deletions
diff --git a/searx/engines/archlinux.py b/searx/engines/archlinux.py
index 9e13dc42e..e2f44b0f5 100644
--- a/searx/engines/archlinux.py
+++ b/searx/engines/archlinux.py
@@ -105,7 +105,7 @@ def request(query, params):
# if our language is hosted on the main site, we need to add its name
# to the query in order to narrow the results to that language
if language in main_langs:
- query += b' (' + main_langs[language] + b')'
+ query += ' (' + main_langs[language] + ')'
# prepare the request parameters
query = urlencode({'search': query})
diff --git a/searx/engines/arxiv.py b/searx/engines/arxiv.py
index 851f30bfc..77ddc572e 100644
--- a/searx/engines/arxiv.py
+++ b/searx/engines/arxiv.py
@@ -30,7 +30,7 @@ def request(query, params):
# basic search
offset = (params['pageno'] - 1) * number_of_results
- string_args = dict(query=query.decode(),
+ string_args = dict(query=query,
offset=offset,
number_of_results=number_of_results)
diff --git a/searx/engines/base.py b/searx/engines/base.py
index 34b735b3c..0114f9798 100755
--- a/searx/engines/base.py
+++ b/searx/engines/base.py
@@ -55,7 +55,7 @@ shorcut_dict = {
def request(query, params):
# replace shortcuts with API advanced search keywords
for key in shorcut_dict.keys():
- query = re.sub(key, shorcut_dict[key], str(query))
+ query = re.sub(key, shorcut_dict[key], query)
# basic search
offset = (params['pageno'] - 1) * number_of_results
diff --git a/searx/engines/bing.py b/searx/engines/bing.py
index eda3d42a3..c7b619369 100644
--- a/searx/engines/bing.py
+++ b/searx/engines/bing.py
@@ -47,7 +47,7 @@ def request(query, params):
else:
lang = match_language(params['language'], supported_languages, language_aliases)
- query = 'language:{} {}'.format(lang.split('-')[0].upper(), query.decode()).encode()
+ query = 'language:{} {}'.format(lang.split('-')[0].upper(), query)
search_path = search_string.format(
query=urlencode({'q': query}),
diff --git a/searx/engines/currency_convert.py b/searx/engines/currency_convert.py
index 7281b7175..c6067c4a8 100644
--- a/searx/engines/currency_convert.py
+++ b/searx/engines/currency_convert.py
@@ -11,13 +11,13 @@ categories = []
url = 'https://duckduckgo.com/js/spice/currency/1/{0}/{1}'
weight = 100
-parser_re = re.compile(b'.*?(\\d+(?:\\.\\d+)?) ([^.0-9]+) (?:in|to) ([^.0-9]+)', re.I)
+parser_re = re.compile('.*?(\\d+(?:\\.\\d+)?) ([^.0-9]+) (?:in|to) ([^.0-9]+)', re.I)
db = 1
def normalize_name(name):
- name = name.decode().lower().replace('-', ' ').rstrip('s')
+ name = name.lower().replace('-', ' ').rstrip('s')
name = re.sub(' +', ' ', name)
return unicodedata.normalize('NFKD', name).lower()
diff --git a/searx/engines/dictzone.py b/searx/engines/dictzone.py
index 1d8470c17..5a1fea3cf 100644
--- a/searx/engines/dictzone.py
+++ b/searx/engines/dictzone.py
@@ -18,7 +18,7 @@ categories = ['general']
url = 'https://dictzone.com/{from_lang}-{to_lang}-dictionary/{query}'
weight = 100
-parser_re = re.compile(b'.*?([a-z]+)-([a-z]+) ([^ ]+)$', re.I)
+parser_re = re.compile('.*?([a-z]+)-([a-z]+) ([^ ]+)$', re.I)
results_xpath = './/table[@id="r"]/tr'
@@ -37,7 +37,7 @@ def request(query, params):
params['url'] = url.format(from_lang=from_lang[2],
to_lang=to_lang[2],
- query=query.decode())
+ query=query)
return params
diff --git a/searx/engines/gentoo.py b/searx/engines/gentoo.py
index b4b02e6b4..b6bc99fab 100644
--- a/searx/engines/gentoo.py
+++ b/searx/engines/gentoo.py
@@ -90,7 +90,7 @@ def request(query, params):
# if our language is hosted on the main site, we need to add its name
# to the query in order to narrow the results to that language
if language in main_langs:
- query += b' (' + (main_langs[language]).encode() + b')'
+ query += ' (' + main_langs[language] + ')'
# prepare the request parameters
query = urlencode({'search': query})
diff --git a/searx/engines/openstreetmap.py b/searx/engines/openstreetmap.py
index 48a2a14b7..5475c7a6d 100644
--- a/searx/engines/openstreetmap.py
+++ b/searx/engines/openstreetmap.py
@@ -30,8 +30,8 @@ route_re = re.compile('(?:from )?(.+) to (.+)')
# do search-request
def request(query, params):
- params['url'] = base_url + search_string.format(query=query.decode())
- params['route'] = route_re.match(query.decode())
+ params['url'] = base_url + search_string.format(query=query)
+ params['route'] = route_re.match(query)
return params
diff --git a/searx/engines/scanr_structures.py b/searx/engines/scanr_structures.py
index 3ed6c6fd5..6dbbf4fd9 100644
--- a/searx/engines/scanr_structures.py
+++ b/searx/engines/scanr_structures.py
@@ -29,7 +29,7 @@ def request(query, params):
params['url'] = search_url
params['method'] = 'POST'
params['headers']['Content-type'] = "application/json"
- params['data'] = dumps({"query": query.decode(),
+ params['data'] = dumps({"query": query,
"searchField": "ALL",
"sortDirection": "ASC",
"sortOrder": "RELEVANCY",
diff --git a/searx/engines/translated.py b/searx/engines/translated.py
index 079eebe3c..a50e7c830 100644
--- a/searx/engines/translated.py
+++ b/searx/engines/translated.py
@@ -16,7 +16,7 @@ url = 'https://api.mymemory.translated.net/get?q={query}&langpair={from_lang}|{t
web_url = 'https://mymemory.translated.net/en/{from_lang}/{to_lang}/{query}'
weight = 100
-parser_re = re.compile(b'.*?([a-z]+)-([a-z]+) (.{2,})$', re.I)
+parser_re = re.compile('.*?([a-z]+)-([a-z]+) (.{2,})$', re.I)
api_key = ''
@@ -39,9 +39,9 @@ def request(query, params):
key_form = ''
params['url'] = url.format(from_lang=from_lang[1],
to_lang=to_lang[1],
- query=query.decode(),
+ query=query,
key=key_form)
- params['query'] = query.decode()
+ params['query'] = query
params['from_lang'] = from_lang
params['to_lang'] = to_lang