From f9e4443ef76fd9c69ae6996568610565e2f680b7 Mon Sep 17 00:00:00 2001 From: Nivesh Krishna Date: Mon, 13 Jun 2022 11:28:08 +0530 Subject: [PATCH 1/2] do not ban engines --- searx/network/raise_for_httperror.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/searx/network/raise_for_httperror.py b/searx/network/raise_for_httperror.py index bd12df9a9..239135660 100644 --- a/searx/network/raise_for_httperror.py +++ b/searx/network/raise_for_httperror.py @@ -61,6 +61,7 @@ def raise_for_httperror(resp): if resp.status_code in (402, 403): raise SearxEngineAccessDeniedException(message='HTTP error ' + str(resp.status_code), suspended_time=3600 * 24) - if resp.status_code == 429: - raise SearxEngineTooManyRequestsException() + # No need to ban the engine for 1 hour because of IP rotation + # if resp.status_code == 429: + # raise SearxEngineTooManyRequestsException() resp.raise_for_status() -- GitLab From a4d3d0ea662e12187e32e699938d21da3c8fa31a Mon Sep 17 00:00:00 2001 From: Nivesh Krishna Date: Mon, 13 Jun 2022 12:57:54 +0530 Subject: [PATCH 2/2] do not raise error for 429 --- searx/network/raise_for_httperror.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/searx/network/raise_for_httperror.py b/searx/network/raise_for_httperror.py index 239135660..0a3a3c00e 100644 --- a/searx/network/raise_for_httperror.py +++ b/searx/network/raise_for_httperror.py @@ -62,6 +62,7 @@ def raise_for_httperror(resp): raise SearxEngineAccessDeniedException(message='HTTP error ' + str(resp.status_code), suspended_time=3600 * 24) # No need to ban the engine for 1 hour because of IP rotation - # if resp.status_code == 429: - # raise SearxEngineTooManyRequestsException() + if resp.status_code == 429: + return + # raise SearxEngineTooManyRequestsException() resp.raise_for_status() -- GitLab