diff options
author | spoob <spoob@gmx.de> | 2010-04-07 18:53:37 +0200 |
---|---|---|
committer | spoob <spoob@gmx.de> | 2010-04-07 18:53:37 +0200 |
commit | b69bf6c7e900d3a8bc26abf421d7f186967b384d (patch) | |
tree | 142628b59096c299b87529367e0b1400c2506598 /module | |
parent | Some Youtube Fixes, ugly (diff) | |
download | pyload-b69bf6c7e900d3a8bc26abf421d7f186967b384d.tar.xz |
Fixed Xup.in
Diffstat (limited to 'module')
-rw-r--r-- | module/Plugin.py | 4 | ||||
-rw-r--r-- | module/plugins/hoster/XupIn.py | 50 |
2 files changed, 13 insertions, 41 deletions
diff --git a/module/Plugin.py b/module/Plugin.py index a9de48c3a..ff4c66c01 100644 --- a/module/Plugin.py +++ b/module/Plugin.py @@ -53,20 +53,16 @@ class Plugin(): def prepare(self, thread): pyfile = self.parent - self.want_reconnect = False - pyfile.status.exists = self.file_exists() if not pyfile.status.exists: return False pyfile.status.filename = self.get_file_name() - pyfile.status.waituntil = self.time_plus_wait pyfile.status.url = self.get_file_url() pyfile.status.want_reconnect = self.want_reconnect - thread.wait(self.parent) return True diff --git a/module/plugins/hoster/XupIn.py b/module/plugins/hoster/XupIn.py index d044f2389..2a914b3d5 100644 --- a/module/plugins/hoster/XupIn.py +++ b/module/plugins/hoster/XupIn.py @@ -19,51 +19,27 @@ class XupIn(Plugin): self.props = props self.parent = parent self.html = None - self.html_old = None #time() where loaded the HTML - self.time_plus_wait = None #time() + wait in seconds - self.posts = {} - self.want_reconnect = None self.multi_dl = False + self.posts = {} + self.url = self.parent.url + if "xup.in/pic" in self.parent.url: + self.url = self.parent.url.replace("xup.in/pic", "xup.in/dl") - def download_html(self): - url = self.parent.url - self.html = self.req.load(url) + def get_file_url(self): self.posts["vid"] = re.search('"hidden" value="(.*)" name="vid"', self.html).group(1) self.posts["vtime"] = re.search('"hidden" value="(.*)" name="vtime"', self.html).group(1) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html == None: - self.download_html() - if not self.want_reconnect: - file_url_pattern = r".*<form action=\"(.*)\" method=\"post\">" - return re.search(file_url_pattern, self.html).group(1) - else: - return False + file_url_pattern = r"<form action=\"(.*)\" method=\"post\">" + return re.search(file_url_pattern, self.html).group(1) def get_file_name(self): - if self.html == None: - self.download_html() - if not self.want_reconnect: - return self.parent.url.split('/')[-2] - else: - return self.parent.url + file_name_pattern = r"<legend> <b>(.+?)</b> </legend>" + return re.search(file_name_pattern, self.html).group(1) def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - if re.search(r"(.*<font color=\"#ff0000\">File does not exist</font>.*)", self.html, re.I) != None: + self.html = self.req.load(self.url) + if re.search(r"File does not exist", self.html) != None or self.html == "": return False - else: - return True + return True def proceed(self, url, location): - self.req.download(url, location, self.posts) - - def wait_until(self): - if self.html == None: - self.download_html() - return self.time_plus_wait + self.req.download(url, location, post=self.posts) |