From 83e0d2c49dee1bc6e1263cbba37591c612a205dd Mon Sep 17 00:00:00 2001 From: RaNaN Date: Fri, 6 May 2011 19:30:41 +0200 Subject: easier implementation of free accounts --- module/plugins/Plugin.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'module/plugins/Plugin.py') diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py index 32e5e8d4d..4d8766250 100644 --- a/module/plugins/Plugin.py +++ b/module/plugins/Plugin.py @@ -90,7 +90,10 @@ class Plugin(object): self.ocr = None # captcha reader instance self.account = pyfile.m.core.accountManager.getAccountPlugin(self.__name__) # account handler instance + self.premium = False + self.user = None + if self.account and not self.account.canUse(): self.account = None if self.account: self.user, data = self.account.selectAccount() @@ -98,6 +101,7 @@ class Plugin(object): self.chunkLimit = -1 #enable chunks for all premium plugins self.resumeDownload = True #also enable resume (both will be ignored if server dont accept chunks) self.multiDL = True #every hoster with account should provides multiple downloads + self.premium = self.account.isPremium(self.user) #premium status else: self.req = pyfile.m.core.requestFactory.getRequest(self.__name__) @@ -113,7 +117,6 @@ class Plugin(object): self.html = None #some plugins store html code here - #self.setup() self.init() def getChunkCount(self): @@ -129,7 +132,7 @@ class Plugin(object): pass def setup(self): - """ setup for enviroment and other things""" + """ setup for enviroment and other things, called before downloading (possibly more than one time)""" pass def preprocessing(self, thread): -- cgit v1.2.3