summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2021-10-26 12:26:43 +0200
committerAlexandre Flament <alex@al-f.net>2021-10-26 12:26:43 +0200
commit64b29ad8387179ba5fdde683ee69d845edce2ede (patch)
treeb18a643eee4997759e291d8a8f5337f0f52afb09
parent9fe1ee4ed964810c7de9a39ec7f865d0df96e5eb (diff)
[mod] microsoft academic: increase timeout to 6 seconds
also avoid a crash when there is no result close #433
-rw-r--r--searx/engines/microsoft_academic.py2
-rw-r--r--searx/settings.yml1
2 files changed, 2 insertions, 1 deletions
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