diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-10-01 04:55:17 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-10-01 04:55:17 +0200 |
commit | 25d5726d4953b93a2e286fd6af8d4ead20670ba6 (patch) | |
tree | 9d38f6942af2fadc094a75dd43699051f356b4d7 /module/plugins/hoster/ExtabitCom.py | |
parent | [AntiVirus] Folder support (diff) | |
download | pyload-25d5726d4953b93a2e286fd6af8d4ead20670ba6.tar.xz |
A lot of plugin code cosmetics
Diffstat (limited to 'module/plugins/hoster/ExtabitCom.py')
-rw-r--r-- | module/plugins/hoster/ExtabitCom.py | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index 0d5533539..b21db38bb 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -35,7 +35,7 @@ class ExtabitCom(SimpleHoster): self.fail(_("Only premium users can download this file")) m = re.search(r"Next free download from your ip will be available in <b>(\d+)\s*minutes", self.html) - if m: + if m is not None: self.wait(int(m.group(1)) * 60, True) elif "The daily downloads limit from your IP is exceeded" in self.html: self.log_warning(_("You have reached your daily downloads limit for today")) @@ -46,21 +46,19 @@ class ExtabitCom(SimpleHoster): fileID = m.group('ID') if m else self.info['pattern']['ID'] m = re.search(r'recaptcha/api/challenge\?k=(\w+)', self.html) - if m: + if m is not None: recaptcha = ReCaptcha(self) captcha_key = m.group(1) - for _i in xrange(5): - get_data = {'type': "recaptcha"} - get_data['capture'], get_data['challenge'] = recaptcha.challenge(captcha_key) - res = json_loads(self.load("http://extabit.com/file/%s/" % fileID, get=get_data)) - if "ok" in res: - self.captcha.correct() - break - else: - self.captcha.invalid() + get_data = {'type': "recaptcha"} + get_data['capture'], get_data['challenge'] = recaptcha.challenge(captcha_key) + + res = json_loads(self.load("http://extabit.com/file/%s/" % fileID, get=get_data)) + + if "ok" in res: + self.captcha.correct() else: - self.fail(_("Invalid captcha")) + self.retry_captcha() else: self.error(_("Captcha")) |