diff options
Diffstat (limited to 'module/plugins/hoster/CzshareCom.py')
-rw-r--r-- | module/plugins/hoster/CzshareCom.py | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py index eeba9d86d..d678f25fa 100644 --- a/module/plugins/hoster/CzshareCom.py +++ b/module/plugins/hoster/CzshareCom.py @@ -12,7 +12,7 @@ from module.utils import parseFileSize as parse_size class CzshareCom(SimpleHoster): __name__ = "CzshareCom" __type__ = "hoster" - __version__ = "1.03" + __version__ = "1.04" __status__ = "testing" __pattern__ = r'http://(?:www\.)?(czshare|sdilej)\.(com|cz)/(\d+/|download\.php\?).+' @@ -67,14 +67,13 @@ class CzshareCom(SimpleHoster): def handle_premium(self, pyfile): - #: Parse download link try: form = re.search(self.PREMIUM_FORM_PATTERN, self.html, re.S).group(1) inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form)) except Exception, e: self.log_error(e) - self.restart(nopremium=True) + self.restart() #: Download the file, destination is determined by pyLoad self.download("http://sdilej.cz/profi_down.php", post=inputs, disposition=True) @@ -106,21 +105,17 @@ class CzshareCom(SimpleHoster): #: Get and decrypt captcha captcha_url = 'http://sdilej.cz/captcha.php' - for _i in xrange(5): - inputs['captchastring2'] = self.captcha.decrypt(captcha_url) - self.html = self.load(parsed_url, post=inputs) + inputs['captchastring2'] = self.captcha.decrypt(captcha_url) + self.html = self.load(parsed_url, post=inputs) - if u"<li>Zadaný ověřovací kód nesouhlasí!</li>" in self.html: - self.captcha.invalid() + if u"<li>Zadaný ověřovací kód nesouhlasí!</li>" in self.html: + self.retry_captcha() - elif re.search(self.MULTIDL_PATTERN, self.html): - self.wait(5 * 60, 12, _("Download limit reached")) + elif re.search(self.MULTIDL_PATTERN, self.html): + self.wait(5 * 60, 12, _("Download limit reached")) - else: - self.captcha.correct() - break else: - self.fail(_("No valid captcha code entered")) + self.captcha.correct() m = re.search("countdown_number = (\d+);", self.html) self.set_wait(int(m.group(1)) if m else 50) @@ -150,14 +145,13 @@ class CzshareCom(SimpleHoster): self.fail(_("File not available - try later")) elif check == "credit": - self.restart(nopremium=True) + self.restart() elif check == "multi-dl": self.wait(5 * 60, 12, _("Download limit reached")) elif check == "captcha": - self.captcha.invalid() - self.retry() + self.retry_captcha() return super(CzshareCom, self).check_download() |