From 4adeedcf1e09fcefe2f8c758199d6fafebebce28 Mon Sep 17 00:00:00 2001 From: mkaay Date: Thu, 6 May 2010 21:15:03 +0200 Subject: account plugins: first draft --- module/plugins/hoster/RapidshareCom.py | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'module/plugins/hoster/RapidshareCom.py') diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py index cfed29331..da38d4b3a 100644 --- a/module/plugins/hoster/RapidshareCom.py +++ b/module/plugins/hoster/RapidshareCom.py @@ -26,13 +26,20 @@ class RapidshareCom(Hoster): self.no_slots = True self.api_data = None self.url = self.parent.url + self.props = {} self.read_config() + self.account = None + self.multi_dl = False if self.config['premium']: - self.multi_dl = True - self.req.canContinue = True - else: - self.multi_dl = False - + self.account = self.parent.core.pluginManager.getAccountPlugin(self.__name__) + req = self.account.getAccountRequest(self) + if req: + self.req = req + self.multi_dl = True + self.req.canContinue = True + else: + self.config['premium'] = False + self.start_dl = False def prepare(self, thread): @@ -73,7 +80,7 @@ class RapidshareCom(Hoster): """ api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi" api_param_file = {"sub": "checkfiles_v1", "files": "", "filenames": "", "incmd5": "1"} - m = re.compile(self.props['pattern']).search(self.url) + m = re.compile(self.__pattern__).search(self.url) if m: api_param_file["files"] = m.group(1) api_param_file["filenames"] = m.group(2) @@ -122,13 +129,13 @@ class RapidshareCom(Hoster): def download_html(self): """ gets the url from self.parent.url saves html in self.html and parses """ - self.html[0] = self.load(self.url, cookies=True) + self.html[0] = self.load(self.url, cookies=False) def get_wait_time(self): """downloads html with the important informations """ file_server_url = re.search(r"