diff options
| author | Alexandre Flament <alex@al-f.net> | 2021-03-18 19:59:01 +0100 |
|---|---|---|
| committer | Alexandre Flament <alex@al-f.net> | 2021-04-10 15:38:33 +0200 |
| commit | eaa694fb7d0e47b943bc6d6edb6cb6a40ab2d85e (patch) | |
| tree | 024786c8a7003be24bbc566cb8c8e734a143f99d /searx/search/checker | |
| parent | 111180705b6f3b142732eb6325de1346f6372828 (diff) | |
[enh] replace requests by httpx
Diffstat (limited to 'searx/search/checker')
| -rw-r--r-- | searx/search/checker/impl.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/searx/search/checker/impl.py b/searx/search/checker/impl.py index ad45440ea..b5fb38a99 100644 --- a/searx/search/checker/impl.py +++ b/searx/search/checker/impl.py @@ -11,7 +11,7 @@ from urllib.parse import urlparse import re from langdetect import detect_langs from langdetect.lang_detect_exception import LangDetectException -import requests.exceptions +import httpx from searx import poolrequests, logger from searx.results import ResultContainer @@ -90,10 +90,10 @@ def _is_url_image(image_url): if r.headers["content-type"].startswith('image/'): return True return False - except requests.exceptions.Timeout: + except httpx.TimeoutException: logger.error('Timeout for %s: %i', image_url, int(time() - a)) retry -= 1 - except requests.exceptions.RequestException: + except httpx.HTTPError: logger.exception('Exception for %s', image_url) return False |