summaryrefslogtreecommitdiff
path: root/searx/engines/google.py
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2021-03-18 19:59:01 +0100
committerAlexandre Flament <alex@al-f.net>2021-04-10 15:38:33 +0200
commiteaa694fb7d0e47b943bc6d6edb6cb6a40ab2d85e (patch)
tree024786c8a7003be24bbc566cb8c8e734a143f99d /searx/engines/google.py
parent111180705b6f3b142732eb6325de1346f6372828 (diff)
downloadsearxng-eaa694fb7d0e47b943bc6d6edb6cb6a40ab2d85e.tar.gz
searxng-eaa694fb7d0e47b943bc6d6edb6cb6a40ab2d85e.zip
[enh] replace requests by httpx
Diffstat (limited to 'searx/engines/google.py')
-rw-r--r--searx/engines/google.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/searx/engines/google.py b/searx/engines/google.py
index 8c20029a3..dcb65df57 100644
--- a/searx/engines/google.py
+++ b/searx/engines/google.py
@@ -10,7 +10,7 @@ Definitions`_.
# pylint: disable=invalid-name, missing-function-docstring
-from urllib.parse import urlencode, urlparse
+from urllib.parse import urlencode
from lxml import html
from searx import logger
from searx.utils import match_language, extract_text, eval_xpath, eval_xpath_list, eval_xpath_getindex
@@ -186,8 +186,7 @@ def get_lang_info(params, lang_list, custom_aliases):
return ret_val
def detect_google_sorry(resp):
- resp_url = urlparse(resp.url)
- if resp_url.netloc == 'sorry.google.com' or resp_url.path.startswith('/sorry'):
+ if resp.url.host == 'sorry.google.com' or resp.url.path.startswith('/sorry'):
raise SearxEngineCaptchaException()