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.

[mod] bing engine: follow redirects (#5324)

Bnyro1d138c5968c3
diff --git a/searx/engines/bing.py b/searx/engines/bing.py
index 3a3112d28..a359ccdfd 100644
--- a/searx/engines/bing.py
+++ b/searx/engines/bing.py
@@ -108,6 +108,10 @@ def request(query, params):
time_ranges = {'day': '1', 'week': '2', 'month': '3', 'year': f'5_{unix_day-365}_{unix_day}'}
params['url'] += f'&filters=ex1:"ez{time_ranges[params["time_range"]]}"'
+ # in some regions where geoblocking is employed (e.g. China),
+ # www.bing.com redirects to the regional version of Bing
+ params['allow_redirects'] = True
+
return params