diff options
| author | asciimoo <asciimoo@gmail.com> | 2014-01-30 01:21:33 +0100 |
|---|---|---|
| committer | asciimoo <asciimoo@gmail.com> | 2014-01-30 01:21:33 +0100 |
| commit | 8b4d445c423a4b26c3e34d8c300b58b04d656590 (patch) | |
| tree | 1ca5214f046d62a59c297f940a18327cbbb31b85 /searx | |
| parent | 89b676ea6faabbcefef3a1044474d0d04c04fd06 (diff) | |
[enh] paging support for google images
Diffstat (limited to 'searx')
| -rw-r--r-- | searx/engines/google_images.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/searx/engines/google_images.py b/searx/engines/google_images.py index 57e749265..a6837f039 100644 --- a/searx/engines/google_images.py +++ b/searx/engines/google_images.py @@ -6,11 +6,13 @@ from json import loads categories = ['images'] url = 'https://ajax.googleapis.com/' -search_url = url + 'ajax/services/search/images?v=1.0&start=0&rsz=large&safe=off&filter=off&{query}' # noqa +search_url = url + 'ajax/services/search/images?v=1.0&start={offset}&rsz=large&safe=off&filter=off&{query}' # noqa def request(query, params): - params['url'] = search_url.format(query=urlencode({'q': query})) + offset = (params['pageno'] - 1) * 8 + params['url'] = search_url.format(query=urlencode({'q': query}), + offset=offset) return params |