diff options
author | Stefano <l.stickell@yahoo.it> | 2014-01-04 20:39:24 +0100 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2014-04-21 16:52:54 +0200 |
commit | 77c2974e3bb6b4bca694e3a0d79b3f7f0db13cb9 (patch) | |
tree | 28055bfa716e3851104a2d9d76bfa9a8edbd7608 | |
parent | CloudzerNet: improved getInfo (diff) | |
download | pyload-77c2974e3bb6b4bca694e3a0d79b3f7f0db13cb9.tar.xz |
CloudzerNet: fixed #185
(cherry picked from commit b7cff12cef8a0c1843a6214aa3f1b4a3a91d9123)
-rw-r--r-- | pyload/plugins/hoster/CloudzerNet.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/pyload/plugins/hoster/CloudzerNet.py b/pyload/plugins/hoster/CloudzerNet.py index 28c4dc6b1..8253c35b9 100644 --- a/pyload/plugins/hoster/CloudzerNet.py +++ b/pyload/plugins/hoster/CloudzerNet.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- import re + from module.plugins.internal.SimpleHoster import SimpleHoster from module.common.json_layer import json_loads from module.plugins.internal.CaptchaService import ReCaptcha @@ -30,9 +31,7 @@ class CloudzerNet(SimpleHoster): __author_name__ = ("gs", "z00nx", "stickell") __author_mail__ = ("I-_-I-_-I@web.de", "z00nx0@gmail.com", "l.stickell@yahoo.it") - FILE_SIZE_PATTERN = '<span class="size">(?P<S>[^<]+)</span>' WAIT_PATTERN = '<meta name="wait" content="(\d+)">' - FILE_OFFLINE_PATTERN = r'Please check the URL for typing errors, respectively' CAPTCHA_KEY = '6Lcqz78SAAAAAPgsTYF3UlGf2QFQCNuPMenuyHF3' def handleFree(self): @@ -69,3 +68,18 @@ class CloudzerNet(SimpleHoster): url = response["url"] self.logDebug("Download link", url) self.download(url, disposition=True) + + def getFileInfo(self): + self.logDebug("URL: %s" % self.pyfile.url) + + header = getURL(self.pyfile.url, just_header=True) + + if 'Location: http://cloudzer.net/404' in header: + self.offline() + else: + self.fid = re.search(self.__pattern__, self.pyfile.url).group('ID') + api_data = getURL('http://cloudzer.net/file/%s/status' % self.fid) + self.pyfile.name, size = api_data.splitlines() + self.pyfile.size = parseFileSize(size) + + self.logDebug("FILE NAME: %s FILE SIZE: %s" % (self.pyfile.name, self.pyfile.size)) |