From a580f52d824997c4acf9a172bac51fae9b996f11 Mon Sep 17 00:00:00 2001 From: spoob Date: Tue, 6 Apr 2010 15:03:03 +0200 Subject: Hotfile Premium --- module/plugins/hoster/HotfileCom.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/HotfileCom.py') diff --git a/module/plugins/hoster/HotfileCom.py b/module/plugins/hoster/HotfileCom.py index aef761da7..5fa05e7f6 100644 --- a/module/plugins/hoster/HotfileCom.py +++ b/module/plugins/hoster/HotfileCom.py @@ -43,6 +43,10 @@ class HotfileCom(Plugin): return False pyfile.status.filename = self.get_file_name() + + if self.config['premium']: + pyfile.status.url = self.get_file_url() + return True self.get_wait_time() pyfile.status.waituntil = self.time_plus_wait @@ -54,18 +58,24 @@ class HotfileCom(Plugin): return True def download_html(self): + if self.config['premium']: + self.req.add_auth(self.config['username'], self.config['password']) self.url = self.parent.url self.html[0] = self.req.load(self.url, cookies=True) def get_file_url(self): - form_content = re.search(r"
\s*)*?\n", self.html[0]).group(0) - form_posts = re.findall(r"", form_content) - self.html[1] = self.req.load(self.url, post=form_posts, cookies=True) - file_url = re.search("a href=\"(http://hotfile\.com/get/\S*?)\"", self.html[1]).group(1) + if self.config['premium']: + file_url_pattern = r'' + file_url = re.search(file_url_pattern, self.html[0]).group(1) + else: + form_content = re.search(r"\s*)*?\n", self.html[0]).group(0) + form_posts = re.findall(r"", form_content) + self.html[1] = self.req.load(self.url, post=form_posts, cookies=True) + file_url = re.search("a href=\"(http://hotfile\.com/get/\S*?)\"", self.html[1]).group(1) return file_url def get_file_name(self): - file_name = re.search(': (.+) |', self.html[0]).group(1) + file_name = re.search(r': (.+?) \|', self.html[0]).group(1) return file_name def file_exists(self): -- cgit v1.2.3