@@ -2,6 +2,7 @@ from collections import Iterable
2from json import loads
2from json import loads
3from sys import version_info
3from sys import version_info
4from searx.url_utils import urlencode
4from searx.url_utils import urlencode
5+from searx.utils import to_string
6if version_info[0] == 3:
7if version_info[0] == 3:
7 unicode = str
8 unicode = str
@@ -111,14 +112,22 @@ def response(resp):
111 content = query(result, content_query)[0]
112 content = query(result, content_query)[0]
113 content = ""
114 content = ""
114− results.append({'url': url, 'title': title, 'content': content})
115+ results.append({
116+ 'url': to_string(url),
117+ 'title': to_string(title),
118+ 'content': to_string(content),
116 for url, title, content in zip(
121 for url, title, content in zip(
117 query(json, url_query),
122 query(json, url_query),
118 query(json, title_query),
123 query(json, title_query),
119 query(json, content_query)
124 query(json, content_query)
121− results.append({'url': url, 'title': title, 'content': content})
126+ results.append({
127+ 'url': to_string(url),
128+ 'title': to_string(title),
129+ 'content': to_string(content),
123 if not suggestion_query:
132 if not suggestion_query:
124 return results
133 return results