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/LuckyShareNet.py | |
parent | [AntiVirus] Folder support (diff) | |
download | pyload-25d5726d4953b93a2e286fd6af8d4ead20670ba6.tar.xz |
A lot of plugin code cosmetics
Diffstat (limited to 'module/plugins/hoster/LuckyShareNet.py')
-rw-r--r-- | module/plugins/hoster/LuckyShareNet.py | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/module/plugins/hoster/LuckyShareNet.py b/module/plugins/hoster/LuckyShareNet.py index 71cccb71a..f9c7a89ef 100644 --- a/module/plugins/hoster/LuckyShareNet.py +++ b/module/plugins/hoster/LuckyShareNet.py @@ -29,10 +29,10 @@ class LuckyShareNet(SimpleHoster): if 'AJAX Error' in rep: html = self.load(self.pyfile.url) m = re.search(r"waitingtime = (\d+);", html) - if m: + if m is not None: seconds = int(m.group(1)) self.log_debug("You have to wait %d seconds between free downloads" % seconds) - self.retry(delay=seconds) + self.retry(wait=seconds) else: self.error(_("Unable to detect wait time between free downloads")) elif 'Hash expired' in rep: @@ -52,24 +52,20 @@ class LuckyShareNet(SimpleHoster): recaptcha = ReCaptcha(self) - for _i in xrange(5): - response, challenge = recaptcha.challenge() - rep = self.load(r"http://luckyshare.net/download/verify/challenge/%s/response/%s/hash/%s" % - (challenge, response, json['hash'])) - self.log_debug("JSON: " + rep) - if 'link' in rep: - json.update(self.parse_json(rep)) - self.captcha.correct() - break - elif 'Verification failed' in rep: - self.captcha.invalid() - else: - self.error(_("Unable to get downlaod link")) + response, challenge = recaptcha.challenge() + rep = self.load(r"http://luckyshare.net/download/verify/challenge/%s/response/%s/hash/%s" % + (challenge, response, json['hash'])) + + self.log_debug("JSON: " + rep) - if not json['link']: - self.fail(_("No Download url retrieved/all captcha attempts failed")) + if 'Verification failed' in rep: + self.retry_captcha() - self.link = json['link'] + elif 'link' in rep: + self.captcha.correct() + json.update(self.parse_json(rep)) + if json['link']: + self.link = json['link'] getInfo = create_getInfo(LuckyShareNet) |