- Category-based search support for BTJunkie engine

This commit is contained in:
Christophe Dumez 2009-08-25 02:45:39 +00:00
parent 8d39e2a776
commit 3d88b7b05c
2 changed files with 6 additions and 5 deletions

View file

@ -1,4 +1,4 @@
#VERSION: 2.11
#VERSION: 2.20
#AUTHORS: Christophe Dumez (chris@qbittorrent.org)
# Redistribution and use in source and binary forms, with or without
@ -34,7 +34,8 @@ import re
class btjunkie(object):
url = 'http://btjunkie.org'
name = 'btjunkie'
supported_categories = {'all': '0', 'movies': '6', 'tv': '4', 'music': '1', 'games': '2', 'anime': '7', 'software': '3'}
def __init__(self):
self.results = []
self.parser = self.SimpleSGMLParser(self.results, self.url)
@ -91,13 +92,13 @@ class btjunkie(object):
prettyPrinter(self.current_item)
self.results.append('a')
def search(self, what):
def search(self, what, cat='all'):
ret = []
i = 1
while True and i<11:
results = []
parser = self.SimpleSGMLParser(results, self.url)
dat = retrieve_url(self.url+'/search?q=%s&o=52&p=%d'%(what,i))
dat = retrieve_url(self.url+'/search?q=%s&c=%s&o=52&p=%d'%(what, cat, i))
# Remove <font> tags from page
p = re.compile( '<[/]?font.*?>')
dat = p.sub('', dat)

View file

@ -1,5 +1,5 @@
isohunt: 1.21
torrentreactor: 1.11
btjunkie: 2.11
btjunkie: 2.20
mininova: 1.31
piratebay: 1.11