tagged rc7

This commit is contained in:
Christophe Dumez
2007-11-03 12:00:41 +00:00
parent b7fd7d9837
commit cce2f9f69f
156 changed files with 35530 additions and 17985 deletions

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 B

View File

@@ -0,0 +1,35 @@
#VERSION: 1.10
#AUTHORS: Fabien Devaux (fab@gnux.info)
from novaprinter import prettyPrinter
import urllib
import re
class btjunkie(object):
url = 'http://btjunkie.org'
name = 'btjunkie'
def search(self, what):
i = 1
while True:
res = 0
dat = urllib.urlopen(self.url+'/search?q=%s&o=52&p=%d'%(what,i)).read().decode('utf8', 'replace')
# I know it's not very readable, but the SGML parser feels in pain
section_re = re.compile('(?s)href="/torrent.*?<tr>')
torrent_re = re.compile('(?s)href="(?P<link>.*?[^"]+).*?'
'class="BlckUnd">(?P<name>.*?)</a>.*?'
'>(?P<size>\d+MB)</font>.*?'
'>(?P<seeds>\d+)</font>.*?'
'>(?P<leech>\d+)</font>')
for match in section_re.finditer(dat):
txt = match.group(0)
m = torrent_re.search(txt)
if m:
torrent_infos = m.groupdict()
torrent_infos['name'] = re.sub('</?font.*?>', '', torrent_infos['name'])
torrent_infos['engine_url'] = self.url
torrent_infos['link'] = self.url+torrent_infos['link']
prettyPrinter(torrent_infos)
res = res + 1
if res == 0:
break
i = i + 1

Binary file not shown.

After

Width:  |  Height:  |  Size: 633 B

View File

@@ -0,0 +1,78 @@
#VERSION: 1.00
#AUTHORS: Gekko Dam Beer (gekko04@users.sourceforge.net)
from novaprinter import prettyPrinter
import sgmllib
import urllib
class isohunt(object):
url = 'http://isohunt.com'
name = 'isoHunt'
class SimpleSGMLParser(sgmllib.SGMLParser):
def __init__(self, results, url, *args):
sgmllib.SGMLParser.__init__(self)
self.td_counter = None
self.current_item = None
self.results = results
self.url = url
def start_tr(self, attr):
params = dict(attr)
if 'onclick' in params:
Durl='http://isohunt.com/download'
self.current_item = {}
self.td_counter = 0
try:
self.current_item['link'] = '%s/%s'%(Durl, params['onclick'].split('/')[2])
except IndexError:
self.current_item['link'] = None
def handle_data(self, data):
if self.td_counter == 3:
if not self.current_item.has_key('name'):
self.current_item['name'] = ''
self.current_item['name']+= data.strip()
if self.td_counter == 4:
if not self.current_item.has_key('size'):
self.current_item['size'] = ''
self.current_item['size']+= data.strip()
if self.td_counter == 5:
if not self.current_item.has_key('seeds'):
self.current_item['seeds'] = ''
self.current_item['seeds']+= data.strip()
if self.td_counter == 6:
if not self.current_item.has_key('leech'):
self.current_item['leech'] = ''
self.current_item['leech']+= data.strip()
def start_td(self,attr):
if isinstance(self.td_counter,int):
self.td_counter += 1
if self.td_counter > 7:
self.td_counter = None
# add item to results
if self.current_item:
self.current_item['engine_url'] = self.url
if not self.current_item.has_key('seeds') or not self.current_item['seeds'].isdigit():
self.current_item['seeds'] = 0
if not self.current_item.has_key('leech') or not self.current_item['leech'].isdigit():
self.current_item['leech'] = 0
if self.current_item['link'] is not None:
prettyPrinter(self.current_item)
self.results.append('a')
def __init__(self):
self.results = []
self.parser = self.SimpleSGMLParser(self.results, self.url)
def search(self, what):
i = 1
while True:
results = []
parser = self.SimpleSGMLParser(results, self.url)
dat = urllib.urlopen(self.url+'/torrents.php?ihq=%s&ihp=%s'%(what,i)).read().decode('utf-8', 'replace')
parser.feed(dat)
parser.close()
if len(results) <= 0:
break
i += 1

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

View File

@@ -0,0 +1,62 @@
#VERSION: 1.11
#AUTHORS: Fabien Devaux (fab@gnux.info)
from novaprinter import prettyPrinter
import urllib
from xml.dom import minidom
import re
class mininova(object):
url = 'http://www.mininova.org'
name = 'Mininova'
table_items = 'added cat name size seeds leech'.split()
def search(self, what):
order = 'seeds' # must be one in self.table_items
def get_link(lnk):
lnks = lnk.getElementsByTagName('a')
i = 0
try:
while not lnks.item(i).attributes.get('href').value.startswith('/get'):
i += 1
except:
return None
return (self.url+lnks.item(i).attributes.get('href').value).strip()
def get_text(txt):
if txt.nodeType == txt.TEXT_NODE:
return txt.toxml()
else:
return ''.join([ get_text(n) for n in txt.childNodes])
page = 1
while True:
res = 0
dat = urllib.urlopen(self.url+'/search/%s/seeds/%d'%(what, page)).read().decode('utf-8', 'replace')
dat = re.sub("<a href=\"http://www.boardreader.com/index.php.*\"", "<a href=\"plop\"", dat)
dat = re.sub("<=", "&lt;=", dat)
dat = re.sub("&\s", "&amp; ", dat)
x = minidom.parseString(dat.encode('utf-8', 'replace'))
table = x.getElementsByTagName('table').item(0)
if not table: return
for tr in table.getElementsByTagName('tr'):
tds = tr.getElementsByTagName('td')
if tds:
i = 0
vals = {}
for td in tds:
if self.table_items[i] == 'name':
vals['link'] = get_link(td)
vals[self.table_items[i]] = get_text(td).strip()
i += 1
vals['engine_url'] = self.url
if not vals['seeds'].isdigit():
vals['seeds'] = 0
if not vals['leech'].isdigit():
vals['leech'] = 0
if vals['link'] is None:
continue
prettyPrinter(vals)
res = res + 1
if res == 0:
break
page = page +1

Binary file not shown.

After

Width:  |  Height:  |  Size: 609 B

View File

@@ -0,0 +1,79 @@
#VERSION: 1.00
#AUTHORS: Fabien Devaux (fab@gnux.info)
from novaprinter import prettyPrinter
import sgmllib
import urllib
class piratebay(object):
url = 'http://thepiratebay.org'
name = 'The Pirate Bay'
def __init__(self):
self.results = []
self.parser = self.SimpleSGMLParser(self.results, self.url)
class SimpleSGMLParser(sgmllib.SGMLParser):
def __init__(self, results, url, *args):
sgmllib.SGMLParser.__init__(self)
self.td_counter = None
self.current_item = None
self.results = results
self.url = url
self.code = 0
def start_a(self, attr):
params = dict(attr)
if params['href'].startswith('/browse'):
self.current_item = {}
self.td_counter = 0
elif params['href'].startswith('/tor'):
self.code = params['href'].split('/')[2]
elif params['href'].startswith('http://torrents.thepiratebay.org/%s'%self.code):
self.current_item['link']=params['href'].strip()
self.td_counter = self.td_counter+1
def handle_data(self, data):
if self.td_counter == 1:
if not self.current_item.has_key('name'):
self.current_item['name'] = ''
self.current_item['name']+= data.strip()
if self.td_counter == 5:
if not self.current_item.has_key('size'):
self.current_item['size'] = ''
self.current_item['size']+= data.strip()
elif self.td_counter == 6:
if not self.current_item.has_key('seeds'):
self.current_item['seeds'] = ''
self.current_item['seeds']+= data.strip()
elif self.td_counter == 7:
if not self.current_item.has_key('leech'):
self.current_item['leech'] = ''
self.current_item['leech']+= data.strip()
def start_td(self,attr):
if isinstance(self.td_counter,int):
self.td_counter += 1
if self.td_counter > 7:
self.td_counter = None
# Display item
if self.current_item:
self.current_item['engine_url'] = self.url
if not self.current_item['seeds'].isdigit():
self.current_item['seeds'] = 0
if not self.current_item['leech'].isdigit():
self.current_item['leech'] = 0
prettyPrinter(self.current_item)
self.results.append('a')
def search(self, what):
ret = []
i = 0
order = 'se'
while True:
results = []
parser = self.SimpleSGMLParser(results, self.url)
dat = urllib.urlopen(self.url+'/search/%s/%u/0/0' % (what, i)).read()
parser.feed(dat)
parser.close()
if len(results) <= 0:
break
i += 1

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 B

View File

@@ -0,0 +1,78 @@
#VERSION: 1.00
#AUTHORS: Gekko Dam Beer (gekko04@users.sourceforge.net)
from novaprinter import prettyPrinter
import sgmllib
import urllib
class torrentreactor(object):
url = 'http://www.torrentreactor.net'
name = 'TorrentReactor.Net'
class SimpleSGMLParser(sgmllib.SGMLParser):
def __init__(self, results, url, *args):
sgmllib.SGMLParser.__init__(self)
self.td_counter = None
self.current_item = None
self.results = results
self.id = None
self.url = url
def start_a(self, attr):
params = dict(attr)
if params['href'].startswith('http://dl.torrentreactor.net/download.php'):
self.current_item = {}
self.td_counter = 0
equal = params['href'].find("=")
amp = params['href'].find("&", equal+1)
self.id = str(int(params['href'][equal+1:amp]))
def handle_data(self, data):
if self.td_counter == 0:
if not self.current_item.has_key('name'):
self.current_item['name'] = ''
self.current_item['name']+= data.strip()
if self.td_counter == 1:
if not self.current_item.has_key('size'):
self.current_item['size'] = ''
self.current_item['size']+= data.strip()
elif self.td_counter == 2:
if not self.current_item.has_key('seeds'):
self.current_item['seeds'] = ''
self.current_item['seeds']+= data.strip()
elif self.td_counter == 3:
if not self.current_item.has_key('leech'):
self.current_item['leech'] = ''
self.current_item['leech']+= data.strip()
def start_td(self,attr):
if isinstance(self.td_counter,int):
self.td_counter += 1
if self.td_counter > 7:
self.td_counter = None
# add item to results
if self.current_item:
self.current_item['link']='http://download.torrentreactor.net/download.php?id=%s&name=%s'%(self.id, urllib.quote(self.current_item['name']))
self.current_item['engine_url'] = self.url
if not self.current_item['seeds'].isdigit():
self.current_item['seeds'] = 0
if not self.current_item['leech'].isdigit():
self.current_item['leech'] = 0
prettyPrinter(self.current_item)
self.has_results = True
self.results.append('a')
def __init__(self):
self.results = []
self.parser = self.SimpleSGMLParser(self.results, self.url)
def search(self, what):
i = 0
while True:
results = []
parser = self.SimpleSGMLParser(results, self.url)
dat = urllib.urlopen(self.url+'/search.php?search=&words=%s&cid=&sid=&type=2&orderby=a.seeds&asc=0&skip=%s'%(what,(i*35))).read().decode('utf-8', 'replace')
parser.feed(dat)
parser.close()
if len(results) <= 0:
break
i += 1

View File

@@ -0,0 +1,5 @@
isohunt: 1.00
torrentreactor: 1.00
btjunkie: 1.10
mininova: 1.11
piratebay: 1.00