From f8f27d90f88014edb9922fe44b87829454110535 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 4 Nov 2014 01:43:16 +0100 Subject: [ZippyshareCom] Update plugin --- module/plugins/hoster/ZippyshareCom.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/ZippyshareCom.py') diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py index 3b5e6df33..9eaf09d04 100644 --- a/module/plugins/hoster/ZippyshareCom.py +++ b/module/plugins/hoster/ZippyshareCom.py @@ -3,6 +3,7 @@ import re from os import path +from urllib import unquote from urlparse import urljoin from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -11,7 +12,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class ZippyshareCom(SimpleHoster): __name__ = "ZippyshareCom" __type__ = "hoster" - __version__ = "0.56" + __version__ = "0.57" __pattern__ = r'(?Phttp://www\d{0,2}\.zippyshare\.com)/v(?:/|iew\.jsp.*key=)(?P\d+)' @@ -20,7 +21,7 @@ class ZippyshareCom(SimpleHoster): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - NAME_PATTERN = r'Zippyshare.com - (?P<N>.+)' + NAME_PATTERN = r'var linkz =.*/(?P.+)";' SIZE_PATTERN = r'>Size:.+?">(?P[\d.,]+) (?P[\w^_]+)' OFFLINE_PATTERN = r'>File does not exist on this server<' @@ -39,12 +40,20 @@ class ZippyshareCom(SimpleHoster): self.download(url) + def getFileInfo(self): + info = super(ZippyshareCom, self).getFileInfo() + self.pyfile.name = info['name'] = unquote(info['name']) + return info + + def get_checksum(self): - m = re.search(r'var ab? = (\d+)\%(\d+)', self.html) - if m: - return int(m.group(1)) % int(m.group(2)) - else: + try: + a = int(re.search(r'var a = (\d+)', self.html).group(1)) + b = int(re.search(r'var ab = a\%(\d+)', self.html).group(1)) + except: self.error(_("Unable to calculate checksum")) + else: + return a % b def get_link(self): -- cgit v1.2.3