From 68d662e689cd42687341c550fb6ebb74e6968d21 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Sep 2014 00:29:57 +0200 Subject: module -> pyload --- pyload/plugins/hoster/ZippyshareCom.py | 74 ++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 pyload/plugins/hoster/ZippyshareCom.py (limited to 'pyload/plugins/hoster/ZippyshareCom.py') diff --git a/pyload/plugins/hoster/ZippyshareCom.py b/pyload/plugins/hoster/ZippyshareCom.py new file mode 100644 index 000000000..d6b7375e2 --- /dev/null +++ b/pyload/plugins/hoster/ZippyshareCom.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +# +# Test links: +# http://www13.zippyshare.com/v/18665333/file.html + +import re + +from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + + +class ZippyshareCom(SimpleHoster): + __name__ = "ZippyshareCom" + __type__ = "hoster" + __version__ = "0.49" + + __pattern__ = r'(?Phttp://www\d{0,2}\.zippyshare.com)/v(?:/|iew.jsp.*key=)(?P\d+)' + + __description__ = """Zippyshare.com hoster plugin""" + __author_name__ = ("spoob", "zoidberg", "stickell", "skylab") + __author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz", "l.stickell@yahoo.it", "development@sky-lab.de") + + FILE_NAME_PATTERN = r'Zippyshare\.com - (?P<N>[^<]+)' + FILE_SIZE_PATTERN = r'>Size:\s*]*>(?P[0-9.,]+) (?P[kKMG]+)i?B
' + FILE_INFO_PATTERN = r'document\.getElementById\(\'dlbutton\'\)\.href = "[^;]*/(?P[^"]+)";' + OFFLINE_PATTERN = r'>File does not exist on this server' + + SH_COOKIES = [(".zippyshare.com", "ziplocale", "en")] + + + def setup(self): + self.multiDL = True + + def handleFree(self): + url = self.get_file_url() + if not url: + self.fail("Download URL not found.") + self.logDebug("Download URL: %s" % url) + self.download(url) + + def get_file_url(self): + """returns the absolute downloadable filepath""" + url_parts = re.search(r'(addthis:url="(http://www(\d+).zippyshare.com/v/(\d*)/file.html))', self.html) + number = url_parts.group(4) + check = re.search(r'