From 59b1df9619770b21eb9ed2e5d7e705ca7f99fb49 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 24 Sep 2014 19:16:52 +0200 Subject: [ZippyshareCom] Partially rewritten --- module/plugins/hoster/ZippyshareCom.py | 73 ++++++++++++++-------------------- 1 file changed, 30 insertions(+), 43 deletions(-) (limited to 'module/plugins/hoster/ZippyshareCom.py') diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py index 33a672198..8d81e6f24 100644 --- a/module/plugins/hoster/ZippyshareCom.py +++ b/module/plugins/hoster/ZippyshareCom.py @@ -1,74 +1,61 @@ # -*- coding: utf-8 -*- -# -# Test links: -# http://www13.zippyshare.com/v/18665333/file.html import re +from os import path +from urlparse import urljoin + from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class ZippyshareCom(SimpleHoster): __name__ = "ZippyshareCom" __type__ = "hoster" - __version__ = "0.49" + __version__ = "0.50" __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") + __description__ = """ Zippyshare.com hoster plugin """ + __author_name__ = ("stickell", "skylab", "Walter Purcaro") + __author_mail__ = ("l.stickell@yahoo.it", "development@sky-lab.de", "vuolter@gmail.com") + 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' + OFFLINE_PATTERN = r'>File does not exist on this server<' SH_COOKIES = [(".zippyshare.com", "ziplocale", "en")] def setup(self): self.multiDL = True + self.resumeDownload = True + def handleFree(self): - url = self.get_file_url() - if not url: - self.fail("Download URL not found.") + url = self.get_link() 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'