summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2022-09-24 11:54:12 +0200
committerMarkus Heiser <markus.heiser@darmarit.de>2022-09-24 13:19:33 +0200
commit3ff2ad939daf5d60f2f8efd1219b33e2fe4572bc (patch)
treec8cdb0c49bac3e55c4b9ccc119856cb33a7060be /searx
parentddd380fc063119e7e6103aaa7db222363cfb2fee (diff)
downloadsearxng-3ff2ad939daf5d60f2f8efd1219b33e2fe4572bc.tar.gz
searxng-3ff2ad939daf5d60f2f8efd1219b33e2fe4572bc.zip
[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 <markus.heiser@darmarit.de>
Diffstat (limited to 'searx')
-rw-r--r--searx/engines/core.py3
1 files changed, 3 insertions, 0 deletions
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)