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/crypter/SafelinkingNet.py | |
parent | [AntiVirus] Folder support (diff) | |
download | pyload-25d5726d4953b93a2e286fd6af8d4ead20670ba6.tar.xz |
A lot of plugin code cosmetics
Diffstat (limited to 'module/plugins/crypter/SafelinkingNet.py')
-rw-r--r-- | module/plugins/crypter/SafelinkingNet.py | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index e2b8471ab..29e1cce4f 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -47,24 +47,25 @@ class SafelinkingNet(Crypter): postData['link-password'] = self.get_password() if "altcaptcha" in self.html: - for _i in xrange(5): - m = re.search(self.SOLVEMEDIA_PATTERN, self.html) - if m: - captchaKey = m.group(1) - captcha = SolveMedia(self) - captchaProvider = "Solvemedia" - else: - self.fail(_("Error parsing captcha")) + m = re.search(self.SOLVEMEDIA_PATTERN, self.html) + if m is not None: + captchaKey = m.group(1) + captcha = SolveMedia(self) + captchaProvider = "Solvemedia" + else: + self.fail(_("Error parsing captcha")) + + response, challenge = captcha.challenge(captchaKey) + postData['adcopy_challenge'] = challenge + postData['adcopy_response'] = response + + self.html = self.load(url, post=postData) - response, challenge = captcha.challenge(captchaKey) - postData['adcopy_challenge'] = challenge - postData['adcopy_response'] = response + if "The CAPTCHA code you entered was wrong" in self.html: + self.retry_captcha() - self.html = self.load(url, post=postData) - if "The password you entered was incorrect" in self.html: - self.fail(_("Incorrect Password")) - if not "The CAPTCHA code you entered was wrong" in self.html: - break + if "The password you entered was incorrect" in self.html: + self.fail(_("Wrong password")) pyfile.package().password = "" soup = BeautifulSoup.BeautifulSoup(self.html) @@ -73,7 +74,7 @@ class SafelinkingNet(Crypter): if "d_links" in s.text: break m = re.search('d_links":(\[.*?\])', s.text) - if m: + if m is not None: linkDict = json_loads(m.group(1)) for link in linkDict: if not "http://" in link['full']: |