summaryrefslogtreecommitdiff
path: root/searx/engines/deviantart.py
diff options
context:
space:
mode:
authorasciimoo <asciimoo@gmail.com>2014-01-30 00:09:47 +0100
committerasciimoo <asciimoo@gmail.com>2014-01-30 00:09:47 +0100
commit1fd91bd911ef07ca32461a063c5560a68d88c2ac (patch)
tree38b36f8ae89ac313b63f73ccbee3ee1a57b9cd82 /searx/engines/deviantart.py
parent9ba17fce4766eb1a73a84a887e39d6abceacd620 (diff)
downloadsearxng-1fd91bd911ef07ca32461a063c5560a68d88c2ac.tar.gz
searxng-1fd91bd911ef07ca32461a063c5560a68d88c2ac.zip
[enh] paging support for deviantart
Diffstat (limited to 'searx/engines/deviantart.py')
-rw-r--r--searx/engines/deviantart.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/searx/engines/deviantart.py b/searx/engines/deviantart.py
index 94a94bf16..602678e41 100644
--- 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