summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-11-01 19:37:18 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-11-01 19:37:18 +0100
commitf42749c593f9ec4db5426592077751193d98ce13 (patch)
treec63599e50a110e956295478cc62244343b342fb5 /module
parent[SimpleHoster] Fix and improve ddl detection, parseFileInfo and getInfo (diff)
downloadpyload-f42749c593f9ec4db5426592077751193d98ce13.tar.xz
[ZippyshareCom] Fix get_checksum (thx zapp-brannigan)
Diffstat (limited to 'module')
-rw-r--r--module/plugins/hoster/ZippyshareCom.py20
1 files changed, 3 insertions, 17 deletions
diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py
index c12322823..549df73e0 100644
--- a/module/plugins/hoster/ZippyshareCom.py
+++ b/module/plugins/hoster/ZippyshareCom.py
@@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class ZippyshareCom(SimpleHoster):
__name__ = "ZippyshareCom"
__type__ = "hoster"
- __version__ = "0.54"
+ __version__ = "0.55"
__pattern__ = r'(?P<HOST>http://www\d{0,2}\.zippyshare\.com)/v(?:/|iew\.jsp.*key=)(?P<KEY>\d+)'
@@ -40,26 +40,12 @@ class ZippyshareCom(SimpleHoster):
def get_checksum(self):
- m = re.search(r'\(a\*b\+19\)', self.html)
+ m = re.search(r'var ab? = (\d+)\%(\d+)', self.html)
if m:
- m = re.findall(r'var \w = (\d+)\%(\d+);', self.html)
- c = lambda a,b: a * b + 19
+ return int(m.group(1)) % int(m.group(2))
else:
- m = re.findall(r'(\d+) \% (\d+)', self.html)
- c = lambda a,b: a + b
-
- if not m:
self.error(_("Unable to calculate checksum"))
- a = map(lambda x: int(x), m[0])
- b = map(lambda x: int(x), m[1])
-
- # Checksum is calculated as (a*b+19) or (a+b), where a and b are the result of modulo calculations
- a = a[0] % a[1]
- b = b[0] % b[1]
-
- return c(a, b)
-
def get_link(self):
checksum = self.get_checksum()