mirror of
https://github.com/searxng/searxng.git
synced 2025-08-31 15:36:50 +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
|
@ -11,13 +11,13 @@
|
|||
|
||||
import re
|
||||
from datetime import datetime, timedelta
|
||||
from urllib.parse import urlencode
|
||||
from lxml import html
|
||||
from searx.engines.xpath import extract_text, extract_url
|
||||
from searx.engines.yahoo import (
|
||||
parse_url, _fetch_supported_languages, supported_languages_url, language_aliases
|
||||
)
|
||||
from dateutil import parser
|
||||
from searx.url_utils import urlencode
|
||||
from searx.utils import match_language
|
||||
|
||||
# engine dependent config
|
||||
|
@ -58,7 +58,7 @@ def request(query, params):
|
|||
|
||||
def sanitize_url(url):
|
||||
if ".yahoo.com/" in url:
|
||||
return re.sub(u"\\;\\_ylt\\=.+$", "", url)
|
||||
return re.sub("\\;\\_ylt\\=.+$", "", url)
|
||||
else:
|
||||
return url
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue