summaryrefslogtreecommitdiff
path: root/searx/engines/translated.py
diff options
context:
space:
mode:
authorDalf <alex@al-f.net>2020-08-06 17:42:46 +0200
committerAlexandre Flament <alex@al-f.net>2020-09-10 10:39:04 +0200
commit1022228d950c2a809ed613df1a515d9a6cafda7c (patch)
treed792dddea1a5b278b018ed4e024cd13340d5c1b1 /searx/engines/translated.py
parent272158944bf13503e2597018fc60a00baddec660 (diff)
downloadsearxng-1022228d950c2a809ed613df1a515d9a6cafda7c.tar.gz
searxng-1022228d950c2a809ed613df1a515d9a6cafda7c.zip
Drop Python 2 (1/n): remove unicode string and url_utils
Diffstat (limited to 'searx/engines/translated.py')
-rw-r--r--searx/engines/translated.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/searx/engines/translated.py b/searx/engines/translated.py
index 6cb18ff39..079eebe3c 100644
--- a/searx/engines/translated.py
+++ b/searx/engines/translated.py
@@ -12,8 +12,8 @@ import re
from searx.utils import is_valid_lang
categories = ['general']
-url = u'https://api.mymemory.translated.net/get?q={query}&langpair={from_lang}|{to_lang}{key}'
-web_url = u'https://mymemory.translated.net/en/{from_lang}/{to_lang}/{query}'
+url = 'https://api.mymemory.translated.net/get?q={query}&langpair={from_lang}|{to_lang}{key}'
+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)
@@ -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('utf-8'),
+ query=query.decode(),
key=key_form)
- params['query'] = query.decode('utf-8')
+ params['query'] = query.decode()
params['from_lang'] = from_lang
params['to_lang'] = to_lang