Skip to content

SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.

[fix] karmasearch engine: setting Referer header to bypass bot detection (#5953)

Aadniz474b0a55b0cb
diff --git a/searx/engines/karmasearch.py b/searx/engines/karmasearch.py
index 140002c3c..a019ec885 100644
--- a/searx/engines/karmasearch.py
+++ b/searx/engines/karmasearch.py
@@ -64,6 +64,9 @@ def request(query: str, params: "OnlineParams") -> None:
if params["time_range"]:
args["freshness"] = time_range_map[params["time_range"]]
+ # Needed to circumvent Cloudflare bot protection
+ params['headers']['Referer'] = "https://karmasearch.org"
+
params["url"] = f"{base_url}/search/{search_type}?{urlencode(args)}"