diff options
author | spoob <spoob@gmx.de> | 2009-06-04 22:52:08 +0200 |
---|---|---|
committer | spoob <spoob@gmx.de> | 2009-06-04 22:52:08 +0200 |
commit | 2e2c33af79d01b3209d8dd71133d3f4b0846d8d1 (patch) | |
tree | eaeceeef61bce801b57687bb0fef33a70222e7d1 /Plugins | |
parent | Added YouPorn.com Plugin (diff) | |
download | pyload-2e2c33af79d01b3209d8dd71133d3f4b0846d8d1.tar.xz |
added buggy Zippyshare.com Download Plugin, fixed gettext bug
Diffstat (limited to 'Plugins')
-rw-r--r-- | Plugins/ZippyshareCom.py | 68 | ||||
-rw-r--r-- | Plugins/ZshareNet.py | 3 |
2 files changed, 69 insertions, 2 deletions
diff --git a/Plugins/ZippyshareCom.py b/Plugins/ZippyshareCom.py new file mode 100644 index 000000000..b059c836c --- /dev/null +++ b/Plugins/ZippyshareCom.py @@ -0,0 +1,68 @@ +#!/usr/bin/env python + +import re +import urllib +from time import time +from Plugin import Plugin + +class ZippyshareCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "ZippyshareCom" + props['type'] = "hoster" + props['pattern'] = r"(http://)?www?\d{0,2}\.zippyshare.com/v/" + props['version'] = "0.1" + props['description'] = """Zippyshare.com Download Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.plugin_config = props + self.parent = parent + self.html = None + self.want_reconnect = False + self.multi_dl = False + + def set_parent_status(self): + """ sets all available Statusinfos about a File in self.parent.status + """ + if self.html == None: + self.download_html() + self.parent.status.filename = self.get_file_name() + self.parent.status.url = self.get_file_url() + self.parent.status.wait = self.wait_until() + + def download_html(self): + url = self.parent.url + self.html = self.req.load(url) + self.time_plus_wait = time() + 10 + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html == None: + self.download_html() + if not self.want_reconnect: + file_url = urllib.unquote(re.search("var comeonguys = 'fck(.*)';", self.html).group(1)) + return file_url + else: + return False + + def get_file_name(self): + if self.html == None: + self.download_html() + if not self.want_reconnect: + file_name = re.search("<strong>Name: </strong>(.*)</font><br />", self.html).group(1) + print file_name + else: + return self.parent.url + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + if re.search(r"HTTP Status 404", self.html) != None: + return False + else: + return True diff --git a/Plugins/ZshareNet.py b/Plugins/ZshareNet.py index 7acc71608..58c32e0ed 100644 --- a/Plugins/ZshareNet.py +++ b/Plugins/ZshareNet.py @@ -21,7 +21,7 @@ class ZshareNet(Plugin): 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.want_reconnect = False self.multi_dl = False def set_parent_status(self): @@ -60,7 +60,6 @@ class ZshareNet(Plugin): self.download_html() if not self.want_reconnect: file_name = re.search("<font color=\"#666666\">(.*)</font></td>", self.html[0]).group(1) - print file_name return file_name else: return self.parent.url |