Browse Source

Fix vertor search engine plugin

adaptive-webui-19844
Christophe Dumez 14 years ago
parent
commit
b8797d075f
  1. 2
      src/searchengine/nova/engines/versions.txt
  2. 34
      src/searchengine/nova/engines/vertor.py

2
src/searchengine/nova/engines/versions.txt

@ -3,7 +3,7 @@ torrentreactor: 1.3
btjunkie: 2.31 btjunkie: 2.31
mininova: 1.50 mininova: 1.50
piratebay: 1.40 piratebay: 1.40
vertor: 1.2 vertor: 1.3
torrentdownloads: 1.1 torrentdownloads: 1.1
extratorrent: 1.1 extratorrent: 1.1
kickasstorrents: 1.1 kickasstorrents: 1.1

34
src/searchengine/nova/engines/vertor.py

@ -1,4 +1,4 @@
#VERSION: 1.2 #VERSION: 1.3
#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
@ -53,12 +53,27 @@ class vertor(object):
self.in_name = False self.in_name = False
self.outside_td = True; self.outside_td = True;
def start_tr(self, attr):
self.td_counter = -1
self.current_item = {}
def end_tr(self):
if self.td_counter == 5:
self.td_counter = None
# Display item
if self.current_item and self.current_item.has_key('link'):
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 start_a(self, attr): def start_a(self, attr):
#if self.td_counter is None or self.td_counter < 0: return
params = dict(attr) params = dict(attr)
#print params
if params.has_key('href') and params['href'].startswith("http://www.vertor.com/index.php?mod=download"): if params.has_key('href') and params['href'].startswith("http://www.vertor.com/index.php?mod=download"):
self.current_item = {}
self.td_counter = 0
self.current_item['link']=params['href'].strip() self.current_item['link']=params['href'].strip()
elif self.td_counter == 0 and params.has_key('href') and params['href'].startswith("/torrents/") \ elif self.td_counter == 0 and params.has_key('href') and params['href'].startswith("/torrents/") \
and not self.current_item.has_key('name'): and not self.current_item.has_key('name'):
@ -94,17 +109,6 @@ class vertor(object):
if isinstance(self.td_counter,int): if isinstance(self.td_counter,int):
self.outside_td = False self.outside_td = False
self.td_counter += 1 self.td_counter += 1
if self.td_counter > 5:
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, cat='all'): def search(self, what, cat='all'):
ret = [] ret = []

Loading…
Cancel
Save