diff --git a/searx/engines/dictzone.py b/searx/engines/dictzone.py index 2483c080..126e7537 100644 --- a/searx/engines/dictzone.py +++ b/searx/engines/dictzone.py @@ -17,7 +17,7 @@ about = { "results": 'HTML', } -engine_type = 'online_dictionnary' +engine_type = 'online_dictionary' categories = ['general'] url = 'https://dictzone.com/{from_lang}-{to_lang}-dictionary/{query}' weight = 100 @@ -27,9 +27,7 @@ https_support = True def request(query, params): - params['url'] = url.format(from_lang=params['from_lang'][2], - to_lang=params['to_lang'][2], - query=params['query']) + params['url'] = url.format(from_lang=params['from_lang'][2], to_lang=params['to_lang'][2], query=params['query']) return params @@ -51,10 +49,12 @@ def response(resp): if t.strip(): to_results.append(to_result.text_content()) - results.append({ - 'url': urljoin(resp.url, '?%d' % k), - 'title': from_result.text_content(), - 'content': '; '.join(to_results) - }) + results.append( + { + 'url': urljoin(str(resp.url), '?%d' % k), + 'title': from_result.text_content(), + 'content': '; '.join(to_results), + } + ) return results diff --git a/searx/search/processors/online_dictionary.py b/searx/search/processors/online_dictionary.py index 987c710a..c9c37b60 100644 --- a/searx/search/processors/online_dictionary.py +++ b/searx/search/processors/online_dictionary.py @@ -5,13 +5,12 @@ import re from searx.utils import is_valid_lang from .online import OnlineProcessor - -parser_re = re.compile('.*?([a-z]+)-([a-z]+) ([^ ]+)$', re.I) +parser_re = re.compile('.*?([a-z]+)-([a-z]+) (.+)$', re.I) class OnlineDictionaryProcessor(OnlineProcessor): - engine_type = 'online_dictionnary' + engine_type = 'online_dictionary' def get_params(self, search_query, engine_category): params = super().get_params(search_query, engine_category)