Browse Source

- Category-based search support for BTJunkie engine

adaptive-webui-19844
Christophe Dumez 16 years ago
parent
commit
3d88b7b05c
  1. 9
      src/search_engine/engines/btjunkie.py
  2. 2
      src/search_engine/engines/versions.txt

9
src/search_engine/engines/btjunkie.py

@ -1,4 +1,4 @@ @@ -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 @@ -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): @@ -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)

2
src/search_engine/engines/versions.txt

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

Loading…
Cancel
Save