From ba1464fde44721edecf389af831876e04adccdeb Mon Sep 17 00:00:00 2001 From: Manatsawin Hanmongkolchai Date: Sun, 9 Oct 2022 23:01:05 +0700 Subject: [PATCH] fix(google_cs): Remove rate limit handling error, as it already use 429 code --- searx/engines/google_cs.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/searx/engines/google_cs.py b/searx/engines/google_cs.py index 1d2d57ced..72d8f1739 100644 --- a/searx/engines/google_cs.py +++ b/searx/engines/google_cs.py @@ -40,8 +40,6 @@ from urllib.parse import urlencode from dateutil.parser import isoparse from searx.engines.google import get_lang_info -from searx.exceptions import SearxEngineTooManyRequestsException -from searx.network import raise_for_httperror about = { "website": 'https://www.google.com', @@ -190,22 +188,11 @@ def request(query, params): params['url'] = base_url.format(query=urlencode(query)) params['headers']['X-Goog-Api-Key'] = api_key - params['raise_for_httperror'] = False return params def response(resp): result = resp.json() - - if resp.status_code == 403: - try: - if result['errors'][0]['reason'] == 'quotaExceeded': - raise SearxEngineTooManyRequestsException(message=result['message']) - except (KeyError, IndexError): - pass - - raise_for_httperror(resp) - metadata = [ {'number_of_results': min(MAX_SEARCH_RESULT, int(result['searchInformation']['totalResults'], 10))}, ]