[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>
This commit is contained in:
Markus Heiser 2022-09-24 11:54:12 +02:00
parent ddd380fc06
commit 3ff2ad939d

View File

@ -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)