diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-11-04 01:43:16 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-11-04 01:43:16 +0100 |
commit | f8f27d90f88014edb9922fe44b87829454110535 (patch) | |
tree | 5fb734309fc461b46cb036ff3d37a8abe5e904b6 /module/plugins/hoster/ZippyshareCom.py | |
parent | Use more print_exc + code cosmetics (diff) | |
download | pyload-f8f27d90f88014edb9922fe44b87829454110535.tar.xz |
[ZippyshareCom] Update plugin
Diffstat (limited to 'module/plugins/hoster/ZippyshareCom.py')
-rw-r--r-- | module/plugins/hoster/ZippyshareCom.py | 21 |
1 files changed, 15 insertions, 6 deletions
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'(?P<HOST>http://www\d{0,2}\.zippyshare\.com)/v(?:/|iew\.jsp.*key=)(?P<KEY>\d+)' @@ -20,7 +21,7 @@ class ZippyshareCom(SimpleHoster): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - NAME_PATTERN = r'<title>Zippyshare.com - (?P<N>.+)</title>' + NAME_PATTERN = r'var linkz =.*/(?P<N>.+)";' SIZE_PATTERN = r'>Size:.+?">(?P<S>[\d.,]+) (?P<U>[\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): |