|  | @@ -6,7 +6,7 @@ from urllib import quote
 | 
	
		
			
			| 6 | 6 |  categories = ['videos', 'music']
 | 
	
		
			
			| 7 | 7 |  
 | 
	
		
			
			| 8 | 8 |  url = '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}'
 | 
	
		
			
			| 10 | 10 |  search_types = {'videos': '200',
 | 
	
		
			
			| 11 | 11 |                  'music': '100',
 | 
	
		
			
			| 12 | 12 |                  'files': '0'}
 | 
	
	
		
			
			|  | @@ -14,11 +14,15 @@ search_types = {'videos': '200',
 | 
	
		
			
			| 14 | 14 |  magnet_xpath = './/a[@title="Download this torrent using magnet"]'
 | 
	
		
			
			| 15 | 15 |  content_xpath = './/font[@class="detDesc"]//text()'
 | 
	
		
			
			| 16 | 16 |  
 | 
	
		
			
			|  | 17 | +paging = True
 | 
	
		
			
			|  | 18 | +
 | 
	
		
			
			| 17 | 19 |  
 | 
	
		
			
			| 18 | 20 |  def request(query, params):
 | 
	
		
			
			| 19 |  | -    search_type = search_types.get(params['category'])
 | 
	
		
			
			|  | 21 | +    search_type = search_types.get(params['category'], '200')
 | 
	
		
			
			| 20 | 22 |      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']
 | 
	
		
			
			| 22 | 26 |      return params
 | 
	
		
			
			| 23 | 27 |  
 | 
	
		
			
			| 24 | 28 |  
 |