Skip to content

Commit

Permalink
Add user-agent to stract requests
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkeldenker authored and return42 committed Mar 22, 2024
1 parent 32bd55e commit b21aaa8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion searx/engines/stract.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"""

from json import dumps
from searx.utils import searx_useragent

about = {
"website": "https://stract.com/",
Expand All @@ -23,7 +24,11 @@
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
Expand Down

0 comments on commit b21aaa8

Please sign in to comment.