summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikkel Denker <mikkel@stract.com>2024-03-22 10:30:53 +0100
committerMarkus Heiser <markus.heiser@darmarIT.de>2024-03-22 13:40:46 +0100
commitb21aaa89075b325bd89d2f9f5dc82bbb66855d12 (patch)
tree65a41655b6357db0813718c4dd0c446543f6c181
parent32bd55e268f153b7ff2a007592fd52f61aff5fb2 (diff)
downloadsearx-b21aaa89075b325bd89d2f9f5dc82bbb66855d12.tar.gz
searx-b21aaa89075b325bd89d2f9f5dc82bbb66855d12.zip
Add user-agent to stract requests
-rw-r--r--searx/engines/stract.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/searx/engines/stract.py b/searx/engines/stract.py
index 2ba26e756..751d4da50 100644
--- a/searx/engines/stract.py
+++ b/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