From df41ecb23f41c05d4700e6481f275040dfb6541e Mon Sep 17 00:00:00 2001 From: ahmad-alkadri Date: Mon, 13 Mar 2023 01:05:29 +0100 Subject: [PATCH] Put CURL's user-agent for DDG MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CURL so far always works for getting response from DDG engine when testing from server. Putting CURL’s user-agent for the DDG engine apparently fix the 403 issue as well. --- searx/engines/duckduckgo.py | 1 + 1 file changed, 1 insertion(+) diff --git a/searx/engines/duckduckgo.py b/searx/engines/duckduckgo.py index 2a7956ca8..542def5fa 100644 --- a/searx/engines/duckduckgo.py +++ b/searx/engines/duckduckgo.py @@ -74,6 +74,7 @@ def request(query, params): params['headers']['Content-Type'] = 'application/x-www-form-urlencoded' params['headers']['Referer'] = 'https://google.com/' + params['headers']['User-Agent'] = 'curl/7.81.0' # initial page does not have an offset if params['pageno'] == 2: