mirror of
https://github.com/searxng/searxng.git
synced 2025-07-30 16:42:22 +02:00
Drop Python 2 (1/n): remove unicode string and url_utils
This commit is contained in:
parent
272158944b
commit
1022228d95
112 changed files with 388 additions and 535 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue