Browse Source

[mod] microsoft academic: increase timeout to 6 seconds

also avoid a crash when there is no result

close #433
Alexandre Flament 3 years ago
parent
commit
64b29ad838
2 changed files with 2 additions and 1 deletions
  1. 1 1
      searx/engines/microsoft_academic.py
  2. 1 0
      searx/settings.yml

+ 1 - 1
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
 

+ 1 - 0
searx/settings.yml

@@ -873,6 +873,7 @@ engines:
     engine: microsoft_academic
     categories: science
     shortcut: ma
+    timeout: 6.0
 
   - name: mixcloud
     engine: mixcloud