From 76b087986aa90967918ec52b459a857c11743203 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 10 Nov 2014 01:06:30 +0100 Subject: [ZippyshareCom] Update patterns --- module/plugins/hoster/ZippyshareCom.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py index 1b2b9bce2..72bdf3171 100644 --- a/module/plugins/hoster/ZippyshareCom.py +++ b/module/plugins/hoster/ZippyshareCom.py @@ -21,7 +21,7 @@ class ZippyshareCom(SimpleHoster): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - NAME_PATTERN = r'("/[di]/\d+/".+?"/|Zippyshare.com - )(?P<N>.+?)("|)' + NAME_PATTERN = r'("\d{6,}/"[ ]*\+.+?"/|Zippyshare.com - )(?P<N>.+?)("|)' SIZE_PATTERN = r'>Size:.+?">(?P[\d.,]+) (?P[\w^_]+)' OFFLINE_PATTERN = r'>File does not exist on this server<' @@ -48,8 +48,13 @@ class ZippyshareCom(SimpleHoster): def get_checksum(self): try: - a1, a2 = map(int, re.search(r'\(\'downloadB\'\).omg = (\d+)%(\d+)', self.html).groups()) - c1, c2 = map(int, re.search(r'\(\'downloadB\'\).omg\) \* \((\d+)%(\d+)', self.html).groups()) + m = re.search(r'\+[ ]*\((\d+)[ ]*\%[ ]*(\d+)[ ]*\+[ ]*(\d+)[ ]*\%[ ]*(\d+)\)[ ]*\+', self.html) + if m: + a1, a2, c1, c2 = map(int, m.groups()) + else: + a1, a2 = map(int, re.search(r'\(\'downloadB\'\).omg = (\d+)%(\d+)', self.html).groups()) + c1, c2 = map(int, re.search(r'\(\'downloadB\'\).omg\) \* \((\d+)%(\d+)', self.html).groups()) + b = (a1 % a2) * (c1 % c2) except: self.error(_("Unable to calculate checksum")) -- cgit v1.2.3