|
@@ -3,11 +3,15 @@ from urllib import urlencode
|
3
|
3
|
|
4
|
4
|
categories = ['videos']
|
5
|
5
|
|
6
|
|
-search_url = 'https://gdata.youtube.com/feeds/api/videos?alt=json&{query}'
|
|
6
|
+search_url = 'https://gdata.youtube.com/feeds/api/videos?alt=json&{query}&start-index={index}&max-results=25' # noqa
|
|
7
|
+
|
|
8
|
+paging = True
|
7
|
9
|
|
8
|
10
|
|
9
|
11
|
def request(query, params):
|
10
|
|
- params['url'] = search_url.format(query=urlencode({'q': query}))
|
|
12
|
+ index = (params['pageno'] - 1) * 25 + 1
|
|
13
|
+ params['url'] = search_url.format(query=urlencode({'q': query}),
|
|
14
|
+ index=index)
|
11
|
15
|
return params
|
12
|
16
|
|
13
|
17
|
|