Browse Source

[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 <markus.heiser@darmarit.de>
Markus Heiser 2 years ago
parent
commit
257dc7d6c4
1 changed files with 1 additions and 1 deletions
  1. 1 1
      searx/engines/duckduckgo.py

+ 1 - 1
searx/engines/duckduckgo.py

@@ -73,7 +73,7 @@ def request(query, params):
     # link again and again ..
     # link again and again ..
 
 
     params['headers']['Content-Type'] = 'application/x-www-form-urlencoded'
     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
     # initial page does not have an offset
     if params['pageno'] == 2:
     if params['pageno'] == 2: