summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/plugins/hoster/ZippyshareCom.py21
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):