diff options
| author | 2014-12-23 17:21:44 +0100 | |
|---|---|---|
| committer | 2014-12-23 17:21:44 +0100 | |
| commit | 1532521dda9dda1656700ea78d14a113ea277412 (patch) | |
| tree | 93e9b6d4021bc652c9678d5025704c97472d87ab /module/plugins | |
| parent | New plugin: CloudzillaToFolder (diff) | |
| download | pyload-1532521dda9dda1656700ea78d14a113ea277412.tar.xz | |
[CloudzillaTo] Password support
Diffstat (limited to 'module/plugins')
| -rw-r--r-- | module/plugins/hoster/CloudzillaTo.py | 18 | 
1 files changed, 16 insertions, 2 deletions
| diff --git a/module/plugins/hoster/CloudzillaTo.py b/module/plugins/hoster/CloudzillaTo.py index 62391e5c7..442b0dd6c 100644 --- a/module/plugins/hoster/CloudzillaTo.py +++ b/module/plugins/hoster/CloudzillaTo.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo  class CloudzillaTo(SimpleHoster):      __name__    = "CloudzillaTo"      __type__    = "hoster" -    __version__ = "0.03" +    __version__ = "0.04"      __pattern__ = r'http://(?:www\.)?cloudzilla\.to/share/file/(?P<ID>[\w^_]+)' @@ -20,6 +20,17 @@ class CloudzillaTo(SimpleHoster):      INFO_PATTERN    = r'title="(?P<N>.+?)">\1</span> <span class="size">\((?P<S>[\d.]+) (?P<U>[\w^_]+)'      OFFLINE_PATTERN = r'>File not found...<' +    PASSWORD_PATTERN = r'<div id="pwd_protected">' + + +    def checkErrors(self): +        m = re.search(self.PASSWORD_PATTERN, self.html) +        if m: +            self.html = self.load(self.pyfile.url, get={'key': self.getPassword()}) + +        if re.search(self.PASSWORD_PATTERN, self.html): +            self.retry(reason="Wrong password") +      def handleFree(self):          self.html = self.load("http://www.cloudzilla.to/generateticket/", @@ -30,7 +41,10 @@ class CloudzillaTo(SimpleHoster):          self.logDebug(ticket)          if 'error' in ticket: -            self.fail(ticket['error']) +            if "File is password protected" in ticket['error']: +                self.retry(reason="Wrong password") +            else: +                self.fail(ticket['error'])          if 'wait' in ticket:              self.wait(int(ticket['wait']), int(ticket['wait']) > 5) | 
