diff options
author | 2015-10-01 04:55:17 +0200 | |
---|---|---|
committer | 2015-10-01 04:55:17 +0200 | |
commit | 25d5726d4953b93a2e286fd6af8d4ead20670ba6 (patch) | |
tree | 9d38f6942af2fadc094a75dd43699051f356b4d7 /module/plugins/hoster/RapidgatorNet.py | |
parent | [AntiVirus] Folder support (diff) | |
download | pyload-25d5726d4953b93a2e286fd6af8d4ead20670ba6.tar.xz |
A lot of plugin code cosmetics
Diffstat (limited to 'module/plugins/hoster/RapidgatorNet.py')
-rw-r--r-- | module/plugins/hoster/RapidgatorNet.py | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py index 3f2003034..711f33e87 100644 --- a/module/plugins/hoster/RapidgatorNet.py +++ b/module/plugins/hoster/RapidgatorNet.py @@ -86,7 +86,7 @@ class RapidgatorNet(SimpleHoster): else: self.account.relogin() - self.retry(delay=60) + self.retry(wait=60) def handle_premium(self, pyfile): @@ -122,29 +122,25 @@ class RapidgatorNet(SimpleHoster): url = "http://rapidgator.net%s" % jsvars.get('captchaUrl', '/download/captcha') self.html = self.load(url) - for _i in xrange(5): - m = re.search(self.LINK_FREE_PATTERN, self.html) - if m: - self.link = m.group(1) - break - else: - captcha = self.handle_captcha() + m = re.search(self.LINK_FREE_PATTERN, self.html) + if m is not None: + self.link = m.group(1) + else: + captcha = self.handle_captcha() - if not captcha: - self.error(_("Captcha pattern not found")) + if not captcha: + self.error(_("Captcha pattern not found")) - response, challenge = captcha.challenge() + response, challenge = captcha.challenge() - self.html = self.load(url, post={'DownloadCaptchaForm[captcha]': "", - 'adcopy_challenge' : challenge, - 'adcopy_response' : response}) + self.html = self.load(url, post={'DownloadCaptchaForm[captcha]': "", + 'adcopy_challenge' : challenge, + 'adcopy_response' : response}) - if "The verification code is incorrect" in self.html: - self.captcha.invalid() - else: - self.captcha.correct() - else: - self.error(_("Download link")) + if "The verification code is incorrect" in self.html: + self.retry_captcha() + else: + self.captcha.correct() def handle_captcha(self): |