From 3ff2ad939daf5d60f2f8efd1219b33e2fe4572bc Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sat, 24 Sep 2022 11:54:12 +0200 Subject: [PATCH] [fix] ERROR searx.engines.core.ac.uk: list index out of range Some result items from core.ac.uk do not have an URL:: Traceback (most recent call last): File "searx/search/processors/online.py", line 154, in search search_results = self._search_basic(query, params) File "searx/search/processors/online.py", line 142, in _search_basic return self.engine.response(response) File "SearXNG/searx/engines/core.py", line 73, in response 'url': source['urls'][0].replace('http://', 'https://', 1), Signed-off-by: Markus Heiser --- searx/engines/core.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/searx/engines/core.py b/searx/engines/core.py index 1fcb68f1f..96543308a 100644 --- a/searx/engines/core.py +++ b/searx/engines/core.py @@ -53,6 +53,9 @@ def response(resp): for result in json_data['data']: source = result['_source'] + if not source['urls']: + continue + time = source['publishedDate'] or source['depositedDate'] if time: date = datetime.fromtimestamp(time / 1000)