on master help sign in
[fix] unicode urls
commit3144ec1d5926a2f445da63fc7d6ea7efe00c6d26 authorAdam Tauber <asciimoo@gmail.com> dateTue 6 Sep 2016, 17:17 (10 years ago) parent596c6b6
2 files changed+3−8
searx/engines/dictzone.py+1−2 searx/engines/translated.py+2−6
searx/engines/dictzone.py+1−2
@@ -13,11 +13,10 @@ import re
1313from urlparse import urljoin
1414from lxml import html
1515from cgi import escape
16−from searx.engines.xpath import extract_text
1716from searx.utils import is_valid_lang
1817
1918categories = ['general']
20−url = 'http://dictzone.com/{from_lang}-{to_lang}-dictionary/{query}'
19+url = u'http://dictzone.com/{from_lang}-{to_lang}-dictionary/{query}'
2120weight = 100
2221
2322parser_re = re.compile(u'.*?([a-z]+)-([a-z]+) ([^ ]+)$', re.I)
searx/engines/translated.py+2−6
@@ -9,16 +9,12 @@
99 @parse url, title, content
1010"""
1111import re
12−from urlparse import urljoin
13−from lxml import html
1412from cgi import escape
15−from searx.engines.xpath import extract_text
1613from searx.utils import is_valid_lang
1714
1815categories = ['general']
19−url = 'http://api.mymemory.translated.net/get?q={query}' \
20− '&langpair={from_lang}|{to_lang}{key}'
21−web_url = 'http://mymemory.translated.net/en/{from_lang}/{to_lang}/{query}'
16+url = u'http://api.mymemory.translated.net/get?q={query}&langpair={from_lang}|{to_lang}{key}'
17+web_url = u'http://mymemory.translated.net/en/{from_lang}/{to_lang}/{query}'
2218weight = 100
2319
2420parser_re = re.compile(u'.*?([a-z]+)-([a-z]+) (.{2,})$', re.I)