From 257dc7d6c40a8c4bae682c6e7e6b764a98c4ec96 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Fri, 3 Feb 2023 08:45:51 +0100 Subject: [PATCH] [fix-2146] set different HTTP Referer header to DuckDuckGo requests For what ever reasons, ddg-lite don't like the Referer https://lite.duckduckgo.com/ In an interactive session in the WEB browser the the Reverer has exactly this value, but ddg-lite don't like this value when the request is build up by SearXNG. The new value is: https://google.com/ What fakes a user comes from a google link. Related: https://github.com/searxng/searxng/pull/2081 Closes: https://github.com/searxng/searxng/issues/2146 Signed-off-by: Markus Heiser --- searx/engines/duckduckgo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/searx/engines/duckduckgo.py b/searx/engines/duckduckgo.py index 84198afc5..2a7956ca8 100644 --- a/searx/engines/duckduckgo.py +++ b/searx/engines/duckduckgo.py @@ -73,7 +73,7 @@ def request(query, params): # link again and again .. params['headers']['Content-Type'] = 'application/x-www-form-urlencoded' - params['headers']['Referer'] = 'https://lite.duckduckgo.com/' + params['headers']['Referer'] = 'https://google.com/' # initial page does not have an offset if params['pageno'] == 2: