assume the order is better the other way round?
This commit is contained in:
@@ -77,7 +77,7 @@ def searx(text):
|
|||||||
search_list = fetch_all_searx_engines()
|
search_list = fetch_all_searx_engines()
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
url = search_list[-1]
|
url = search_list[0]
|
||||||
logger.info('Currently feeding from {} (of {} in stock)'.format(url, len(search_list)))
|
logger.info('Currently feeding from {} (of {} in stock)'.format(url, len(search_list)))
|
||||||
response = requests.get(url, params={
|
response = requests.get(url, params={
|
||||||
'q': text,
|
'q': text,
|
||||||
@@ -85,13 +85,13 @@ def searx(text):
|
|||||||
'lang': 'de'
|
'lang': 'de'
|
||||||
})
|
})
|
||||||
if response.status_code == 429:
|
if response.status_code == 429:
|
||||||
search_list.pop()
|
search_list.pop(0)
|
||||||
raise RateLimitingError(response=response, request=response.request)
|
raise RateLimitingError(response=response, request=response.request)
|
||||||
try:
|
try:
|
||||||
response = response.json()
|
response = response.json()
|
||||||
except json.JSONDecodeError:
|
except json.JSONDecodeError:
|
||||||
# "maintenance" they say...
|
# "maintenance" they say...
|
||||||
search_list.pop()
|
search_list.pop(0)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
if not response['results']:
|
if not response['results']:
|
||||||
|
|||||||
Reference in New Issue
Block a user