summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/RapidgatorNet.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/RapidgatorNet.py')
-rw-r--r--module/plugins/hoster/RapidgatorNet.py36
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):