From 1d138c5968c373c58f2c45fbea7fd30e59bb35a8 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Fri, 17 Oct 2025 15:43:49 +0200 Subject: [PATCH] [mod] bing engine: follow redirects (#5324) Apparently, in China, Bing redirects from `www.bing.com` to `cn.bing.com`. So in order to make Bing work for chinese users by default, we have to follow that redirect. related: https://github.com/searxng/searxng/issues/5243 --- searx/engines/bing.py | 4 ++++ 1 file changed, 4 insertions(+) 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