From 4bcdf9c2bc52be25f47bbd054fa5a77d812e4021 Mon Sep 17 00:00:00 2001 From: Thorsten Date: Fri, 5 Jul 2019 18:08:41 +0200 Subject: [PATCH] fix broken searx engines, again --- distbot/plugins/searx.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/distbot/plugins/searx.py b/distbot/plugins/searx.py index 199c792..802d0ba 100644 --- a/distbot/plugins/searx.py +++ b/distbot/plugins/searx.py @@ -5,15 +5,13 @@ import logging import requests from lxml import html, etree from requests import HTTPError, ConnectionError -from requests.exceptions import SSLError +from requests.exceptions import SSLError, ContentDecodingError from distbot.bot.worker import Worker from distbot.common.action import Action -from distbot.common.config import conf_get from distbot.common.message import get_words from distbot.common.utils import retry - logger = logging.getLogger(__name__) @@ -74,6 +72,9 @@ class Searx(Worker): except SSLError: self.search_list.pop(0) raise + except ContentDecodingError: + self.search_list.pop(0) + raise if response.status_code == 429: self.search_list.pop(0) -- 2.39.2