Browse Source

- Category-based search support for BTJunkie engine

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

7
src/search_engine/engines/btjunkie.py

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

2
src/search_engine/engines/versions.txt

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

Loading…
Cancel
Save