on master help sign in
[fix] unicode urls
3144ec1Adam Tauber
searx/engines/dictzone.py+1−2
@@ -13,11 +13,10 @@ import re
13from urlparse import urljoin
13from urlparse import urljoin
14from lxml import html
14from lxml import html
15from cgi import escape
15from cgi import escape
16−from searx.engines.xpath import extract_text
17from searx.utils import is_valid_lang
16from searx.utils import is_valid_lang
18
17
19categories = ['general']
18categories = ['general']
20−url = 'http://dictzone.com/{from_lang}-{to_lang}-dictionary/{query}'
19+url = u'http://dictzone.com/{from_lang}-{to_lang}-dictionary/{query}'
21weight = 100
20weight = 100
22
21
23parser_re = re.compile(u'.*?([a-z]+)-([a-z]+) ([^ ]+)$', re.I)
22parser_re = re.compile(u'.*?([a-z]+)-([a-z]+) ([^ ]+)$', re.I)
searx/engines/translated.py+2−6
@@ -9,16 +9,12 @@
9 @parse url, title, content
9 @parse url, title, content
10"""
10"""
11import re
11import re
12−from urlparse import urljoin
13−from lxml import html
14from cgi import escape
12from cgi import escape
15−from searx.engines.xpath import extract_text
16from searx.utils import is_valid_lang
13from searx.utils import is_valid_lang
17
14
18categories = ['general']
15categories = ['general']
19−url = 'http://api.mymemory.translated.net/get?q={query}' \
16+url = u'http://api.mymemory.translated.net/get?q={query}&langpair={from_lang}|{to_lang}{key}'
20− '&langpair={from_lang}|{to_lang}{key}'
21−web_url = 'http://mymemory.translated.net/en/{from_lang}/{to_lang}/{query}'
17+web_url = u'http://mymemory.translated.net/en/{from_lang}/{to_lang}/{query}'
22weight = 100
18weight = 100
23
19
24parser_re = re.compile(u'.*?([a-z]+)-([a-z]+) (.{2,})$', re.I)
20parser_re = re.compile(u'.*?([a-z]+)-([a-z]+) (.{2,})$', re.I)