on master help sign in
[fix] Google image with special chars

It seems like Google image is doing a double urlencode on the url of the images. So we need to unquote once before sending to the browser the urls. It solves the 404 we could see with some image with specials chars in url. Exemple https://searx.laquadrature.net/?q=etes&pageno=1&category_images (there are two of those in the list)

commitb973081134bcb8f727b178128224f4a7a741c3ad authorCqoicebordel <Cqoicebordel@users.noreply.github.com> dateMon 8 Dec 2014, 21:12 (12 years ago) parent9517f7a
1 file changed+2−2
searx/engines/google_images.py+2−2
searx/engines/google_images.py+2−2
@@ -9,7 +9,7 @@
99# @stable yes (but deprecated)
1010# @parse url, title, img_src
1111
12−from urllib import urlencode
12+from urllib import urlencode,unquote
1313from json import loads
1414
1515# engine dependent config
@@ -52,7 +52,7 @@ def response(resp):
5252 results.append({'url': href,
5353 'title': title,
5454 'content': '',
55− 'img_src': result['url'],
55+ 'img_src': unquote(result['url']),
5656 'template': 'images.html'})
5757
5858 # return results