Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix-2146] set different HTTP Referer header to DuckDuckGo requests #2161

Merged
merged 1 commit into from Feb 3, 2023

Conversation

return42
Copy link
Member

@return42 return42 commented Feb 3, 2023

For what ever reasons, ddg-lite don't like the Referer

https://lite.duckduckgo.com/

In an interactive session in the WEB browser the Referer 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: #2081

Closes: #2146

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: searxng#2081
Closes: searxng#2146

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
@return42 return42 mentioned this pull request Feb 3, 2023
Copy link
Contributor

@ahmad-alkadri ahmad-alkadri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested in my local instance with a lot of queries; DDG works well and so does the other engines.

Some examples:

screenshot-127 0 0 1_8888-2023 02 03-09_34_34

screenshot-127 0 0 1_8888-2023 02 03-09_34_47

Really surprising that they'd be blocking based on the Referer of their own website to be honest.

@return42
Copy link
Member Author

return42 commented Feb 3, 2023

Really surprising that they'd be blocking based on the Referer of their own website to be honest.

Like it is often in hacking .. it was just a typo that brought it to my attention. But I could not explain myself why this is so 😃

DDG works well and so does the other engines.

Other engines are not related to this patch .. if they work for you in your test this doesn't say anything about a daily usage on a public instance .. e.g. the startpage CAPTCHA will come back at some point.

@return42 return42 merged commit 9faf0dc into searxng:master Feb 3, 2023
@return42 return42 deleted the fix-2146 branch February 3, 2023 09:35
@ahmad-alkadri
Copy link
Contributor

Like it is often in hacking ..

Somebody's probably good at it at DDG then 👀

Other engines are not related to this patch .. if they work for you in your test this doesn't say anything about a daily usage on a public instance .. e.g. the startpage CAPTCHA will come back at some point.

You're right and I admit I should've known this but it was my OCD+trauma talking tbh 😂

Thanks a lot for this patch!

@return42 return42 mentioned this pull request Feb 10, 2023
return42 added a commit to return42/searxng that referenced this pull request Oct 10, 2023
We have had problems with this before, the bot protection from ddg-lite seems to
have included this referer in the rating [1][2].

From reverse engineering:

- The Referer ``https://google.com/`` was set in commt 257dc7d --> DDG lite
  does not like this referer anymore!

- The 'Referer' header is only set on second and follow up pages but not on the
  first page

- The vqd value is not needed on the first page, the ddg-lite client sets this
  value only on follow up pages / this can help to reduce the vqd requests from
  SearXNG.

Related to 'Referer' header & ddg requests:

[1] searxng#2161
[2] searxng#2081

Closes: searxng#2796
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
return42 added a commit that referenced this pull request Oct 10, 2023
We have had problems with this before, the bot protection from ddg-lite seems to
have included this referer in the rating [1][2].

From reverse engineering:

- The Referer ``https://google.com/`` was set in commt 257dc7d --> DDG lite
  does not like this referer anymore!

- The 'Referer' header is only set on second and follow up pages but not on the
  first page

- The vqd value is not needed on the first page, the ddg-lite client sets this
  value only on follow up pages / this can help to reduce the vqd requests from
  SearXNG.

Related to 'Referer' header & ddg requests:

[1] #2161
[2] #2081

Closes: #2796
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: duckduckgo engine
2 participants