mirror of
https://github.com/searxng/searxng.git
synced 2026-05-07 18:03:51 +02:00
[fix] google: decode urls before passing them onto results (#5674)
Fixes #5673
This commit is contained in:
@@ -17,7 +17,7 @@ import re
|
|||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
import time
|
import time
|
||||||
from urllib.parse import urlencode
|
from urllib.parse import urlencode, unquote
|
||||||
from lxml import html
|
from lxml import html
|
||||||
import babel
|
import babel
|
||||||
import babel.core
|
import babel.core
|
||||||
@@ -373,7 +373,7 @@ def response(resp: "SXNG_Response"):
|
|||||||
if raw_url is None:
|
if raw_url is None:
|
||||||
logger.debug('ignoring item from the result_xpath list: missing url of title "%s"', title)
|
logger.debug('ignoring item from the result_xpath list: missing url of title "%s"', title)
|
||||||
continue
|
continue
|
||||||
url = raw_url[7:].split('&sa=U')[0] # remove the google redirector
|
url = unquote(raw_url[7:].split('&sa=U')[0]) # remove the google redirector
|
||||||
|
|
||||||
content_nodes = eval_xpath(result, './/div[contains(@data-sncf, "1")]')
|
content_nodes = eval_xpath(result, './/div[contains(@data-sncf, "1")]')
|
||||||
for item in content_nodes:
|
for item in content_nodes:
|
||||||
|
|||||||
Reference in New Issue
Block a user