From 1e9dab08e6102383840777e61732fa8e2df78d7c Mon Sep 17 00:00:00 2001 From: David A Roberts Date: Sun, 14 Aug 2016 21:46:54 +1000 Subject: [PATCH] [fix] behaviour for page_size>1 and first_page_num>0 eg. pageno=1,21,41,... instead of 20,40,60,... --- searx/engines/json_engine.py | 2 +- searx/engines/xpath.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/searx/engines/json_engine.py b/searx/engines/json_engine.py index a824c38e5..4604c3cac 100644 --- a/searx/engines/json_engine.py +++ b/searx/engines/json_engine.py @@ -81,7 +81,7 @@ def request(query, params): fp = {'query': query} if paging and search_url.find('{pageno}') >= 0: - fp['pageno'] = (params['pageno'] + first_page_num - 1) * page_size + fp['pageno'] = (params['pageno'] - 1) * page_size + first_page_num params['url'] = search_url.format(**fp) params['query'] = query diff --git a/searx/engines/xpath.py b/searx/engines/xpath.py index e701c02bf..e5c0c5bea 100644 --- a/searx/engines/xpath.py +++ b/searx/engines/xpath.py @@ -87,7 +87,7 @@ def request(query, params): fp = {'query': query} if paging and search_url.find('{pageno}') >= 0: - fp['pageno'] = (params['pageno'] + first_page_num - 1) * page_size + fp['pageno'] = (params['pageno'] - 1) * page_size + first_page_num params['url'] = search_url.format(**fp) params['query'] = query