diff options
author | spoob <spoob@gmx.de> | 2010-01-17 23:13:05 +0100 |
---|---|---|
committer | spoob <spoob@gmx.de> | 2010-01-17 23:13:05 +0100 |
commit | 57639a54f779abaff98a20fb741ce1781748166b (patch) | |
tree | b8e0ad3284cac9d07a09bcc85cc3be81d306065f /module/plugins | |
parent | Fixed Reconnect (diff) | |
download | pyload-57639a54f779abaff98a20fb741ce1781748166b.tar.xz |
Fixed Hotfile
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/hoster/HotfileCom.py | 56 |
1 files changed, 15 insertions, 41 deletions
diff --git a/module/plugins/hoster/HotfileCom.py b/module/plugins/hoster/HotfileCom.py index a046cb6b1..a9853100c 100644 --- a/module/plugins/hoster/HotfileCom.py +++ b/module/plugins/hoster/HotfileCom.py @@ -19,17 +19,18 @@ class HotfileCom(Plugin): props['author_mail'] = ("sitacuisses@yhoo.de","spoob@pyload.org","mkaay@mkaay.de") self.props = props self.parent = parent - self.html = None + self.html = [None, None] self.want_reconnect = False self.multi_dl = False self.htmlwithlink = None self.url = None - + def prepare(self, thread): pyfile = self.parent self.want_reconnect = False - + + self.download_html() pyfile.status.exists = self.file_exists() if not pyfile.status.exists: @@ -45,47 +46,31 @@ class HotfileCom(Plugin): thread.wait(self.parent) pyfile.status.url = self.get_file_url() - return True def download_html(self): self.url = self.parent.url - self.html = self.req.load(self.url) + self.html[0] = self.req.load(self.url, cookies=True) def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html == None: - self.download_html() - if not self.want_reconnect: - self.get_download_page() - file_url = re.search("a href=\"(http://hotfile\.com/get/\S*?)\"", self.htmlwithlink).group(1) - return file_url - else: - return False + form_content = re.search(r"<form style=.*(\n<.*>\s*)*?\n<tr>", self.html[0]).group(0) + form_posts = re.findall(r"<input\stype=hidden\sname=(\S*)\svalue=(\S*)>", 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): - if self.html == None: - self.download_html() - if not self.want_reconnect: - file_name = re.search('Downloading\s<b>(.*?)</b>', self.html).group(1) - return file_name - else: - return self.parent.url + file_name = re.search('Downloading\s<b>(.*?)</b>', self.html[0]).group(1) + return file_name def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - if re.search(r"Such file does not exist or it has been removed for infringement of copyrights.", self.html) != None: + if re.search(r"Such file does not exist or it has been removed for infringement of copyrights.", self.html[0]) != None: return False - else: - return True + return True def get_wait_time(self): free_limit_pattern = re.compile(r"timerend=d\.getTime\(\)\+(\d+);") - matches = free_limit_pattern.findall(self.html) + matches = free_limit_pattern.findall(self.html[0]) if matches: for match in matches: if int(match) == 60000: @@ -97,14 +82,3 @@ class HotfileCom(Plugin): self.want_reconnect = True return True self.time_plus_wait = time() + 65 - - def get_download_page(self): - herewego = re.search(r"<form style=.*(\n<.*>\s*)*?\n<tr>", self.html).group(0) - all_the_tuples = re.findall(r"<input\stype=hidden\sname=(\S*)\svalue=(\S*)>", herewego) - - self.htmlwithlink = self.req.load(self.url, None, all_the_tuples) - - def proceed(self, url, location): - - self.req.download(url, location) - |