summaryrefslogtreecommitdiff
path: root/searx/engines/soundcloud.py
diff options
context:
space:
mode:
authorasciimoo <asciimoo@gmail.com>2014-01-30 01:50:15 +0100
committerasciimoo <asciimoo@gmail.com>2014-01-30 01:50:15 +0100
commit6cbf9bf67d540b0d753fb1c500959825f92d528b (patch)
tree729e22d7e6838e11d5b3791fd1c031223fffeb47 /searx/engines/soundcloud.py
parentc567308e4925cfce9a9725aaf5a3f9139ff2d30e (diff)
downloadsearxng-6cbf9bf67d540b0d753fb1c500959825f92d528b.tar.gz
searxng-6cbf9bf67d540b0d753fb1c500959825f92d528b.zip
[enh] paging support for soundcloud
Diffstat (limited to 'searx/engines/soundcloud.py')
-rw-r--r--searx/engines/soundcloud.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/searx/engines/soundcloud.py b/searx/engines/soundcloud.py
index b1930b2ee..e28fb1600 100644
--- a/searx/engines/soundcloud.py
+++ b/searx/engines/soundcloud.py
@@ -5,12 +5,15 @@ categories = ['music']
guest_client_id = 'b45b1aa10f1ac2941910a7f0d10f8e28'
url = 'https://api.soundcloud.com/'
-search_url = url + 'search?{query}&facet=model&limit=20&offset=0&linked_partitioning=1&client_id='+guest_client_id # noqa
+search_url = url + 'search?{query}&facet=model&limit=20&offset={offset}&linked_partitioning=1&client_id='+guest_client_id # noqa
+
+paging = True
def request(query, params):
- global search_url
- params['url'] = search_url.format(query=urlencode({'q': query}))
+ offset = (params['pageno'] - 1) * 20
+ params['url'] = search_url.format(query=urlencode({'q': query}),
+ offset=offset)
return params