@@ -6,7 +6,7 @@ from urllib import quote
66categories = ['videos', 'music']
77
88url = 'https://thepiratebay.se/'
9−search_url = url + 'search/{search_term}/0/99/{search_type}'
9+search_url = url + 'search/{search_term}/{pageno}/99/{search_type}'
1010search_types = {'videos': '200',
1111 'music': '100',
1212 'files': '0'}
@@ -14,11 +14,15 @@ search_types = {'videos': '200',
1414magnet_xpath = './/a[@title="Download this torrent using magnet"]'
1515content_xpath = './/font[@class="detDesc"]//text()'
1616
17+paging = True
18+
1719
1820def request(query, params):
19− search_type = search_types.get(params['category'])
21+ search_type = search_types.get(params['category'], '200')
2022 params['url'] = search_url.format(search_term=quote(query),
21− search_type=search_type)
23+ search_type=search_type,
24+ pageno=params['pageno'] - 1)
25+ print params['url']
2226 return params
2327
2428