summaryrefslogtreecommitdiff
path: root/searx/engines/google_images.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/google_images.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/google_images.py')
-rw-r--r--searx/engines/google_images.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/searx/engines/google_images.py b/searx/engines/google_images.py
index f0e9e27e3..9dd5fad2c 100644
--- a/searx/engines/google_images.py
+++ b/searx/engines/google_images.py
@@ -24,11 +24,10 @@ Definitions`_.
"""
-import urllib
+from urllib.parse import urlencode, urlparse, unquote
from lxml import html
from flask_babel import gettext
from searx import logger
-from searx.url_utils import urlencode, urlparse
from searx.utils import eval_xpath
from searx.engines.xpath import extract_text
@@ -87,7 +86,7 @@ def scrap_img_by_id(script, data_id):
if 'gstatic.com/images' in line and data_id in line:
url_line = _script[i + 1]
img_url = url_line.split('"')[1]
- img_url = urllib.parse.unquote(img_url.replace(r'\u00', r'%'))
+ img_url = unquote(img_url.replace(r'\u00', r'%'))
return img_url