[fix] mojeek: first search page is rate-limited

Mojeek blocks all requests where the page offset parameter `s`
is set to 0, hence we may not set it for fetching the first results page.
This commit is contained in:
Bnyro
2025-12-03 12:36:29 +01:00
parent 5450d22796
commit 1f6ea41272

View File

@@ -65,7 +65,8 @@ def request(query, params):
if search_type: if search_type:
args['fmt'] = search_type args['fmt'] = search_type
if search_type == '': # setting the page number on the first page (i.e. s=0) triggers a rate-limit
if search_type == '' and params['pageno'] > 1:
args['s'] = 10 * (params['pageno'] - 1) args['s'] = 10 * (params['pageno'] - 1)
if params['time_range'] and search_type != 'images': if params['time_range'] and search_type != 'images':