From 64b29ad8387179ba5fdde683ee69d845edce2ede Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Tue, 26 Oct 2021 12:26:43 +0200 Subject: [PATCH] [mod] microsoft academic: increase timeout to 6 seconds also avoid a crash when there is no result close #433 --- searx/engines/microsoft_academic.py | 2 +- searx/settings.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/searx/engines/microsoft_academic.py b/searx/engines/microsoft_academic.py index 82a5d3550..c99611049 100644 --- a/searx/engines/microsoft_academic.py +++ b/searx/engines/microsoft_academic.py @@ -47,7 +47,7 @@ def response(resp): if not response_data: return results - for result in response_data['pr']: + for result in response_data.get('pr', {}): if 'dn' not in result['paper']: continue diff --git a/searx/settings.yml b/searx/settings.yml index 514eb865e..f53e3257b 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -873,6 +873,7 @@ engines: engine: microsoft_academic categories: science shortcut: ma + timeout: 6.0 - name: mixcloud engine: mixcloud