mirror of
https://github.com/searxng/searxng.git
synced 2025-11-19 21:13:08 -05:00
[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
This commit is contained in:
parent
3e7e404fda
commit
1d138c5968
@ -108,6 +108,10 @@ def request(query, params):
|
|||||||
time_ranges = {'day': '1', 'week': '2', 'month': '3', 'year': f'5_{unix_day-365}_{unix_day}'}
|
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"]]}"'
|
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
|
return params
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user