commit: 1fd91bd911ef07ca32461a063c5560a68d88c2ac
parent: 9ba17fce4766eb1a73a84a887e39d6abceacd620
Author: asciimoo <asciimoo@gmail.com>
Date: Thu, 30 Jan 2014 00:09:47 +0100
[enh] paging support for deviantart
Diffstat:
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/searx/engines/deviantart.py b/searx/engines/deviantart.py
@@ -5,12 +5,15 @@ from urlparse import urljoin
categories = ['images']
base_url = 'https://www.deviantart.com/'
-search_url = base_url+'search?'
+search_url = base_url+'search?offset={offset}&{query}'
+
+paging = True
def request(query, params):
- global search_url
- params['url'] = search_url + urlencode({'q': query})
+ offset = (params['pageno'] - 1) * 24
+ params['url'] = search_url.format(offset=offset,
+ query=urlencode({'q': query}))
return params