Browse Source

Add user-agent to stract requests

Mikkel Denker 1 year ago
parent
commit
b21aaa8907
1 changed files with 6 additions and 1 deletions
  1. 6 1
      searx/engines/stract.py

+ 6 - 1
searx/engines/stract.py

@@ -6,6 +6,7 @@ ends.
 """
 
 from json import dumps
+from searx.utils import searx_useragent
 
 about = {
     "website": "https://stract.com/",
@@ -23,7 +24,11 @@ search_url = "https://stract.com/beta/api/search"
 def request(query, params):
     params['url'] = search_url
     params['method'] = "POST"
-    params['headers'] = {'Accept': 'application/json', 'Content-Type': 'application/json'}
+    params['headers'] = {
+        'Accept': 'application/json',
+        'Content-Type': 'application/json',
+        'User-Agent': searx_useragent(),
+    }
     params['data'] = dumps({'query': query, 'page': params['pageno'] - 1})
 
     return params