From 36152ba7dec241e9b10cfc01bd2aeb78547cb046 Mon Sep 17 00:00:00 2001 From: Nold360 Date: Tue, 16 Apr 2013 10:00:46 +0200 Subject: Added circlecaptcha to NCryptIn-Plugin --- module/plugins/crypter/NCryptIn.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/NCryptIn.py') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index a8eaac631..996ff581e 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -52,6 +52,7 @@ class NCryptIn(Crypter): package_links.extend(self.handleContainers()) package_links.extend(self.handleCNL2()) package_links = set(package_links) + self.logDebug(package_links) # Pack self.packages = [(package_name, package_links, folder_name)] @@ -65,7 +66,7 @@ class NCryptIn(Crypter): rexpr = re.compile(pattern, re.DOTALL) content = re.sub(rexpr, "", content) return content - + def isOnline(self): if "Your folder does not exist" in self.cleanedHtml: self.logDebug("File not found") @@ -121,6 +122,19 @@ class NCryptIn(Crypter): challenge, code = recaptcha.challenge(id) postData['recaptcha_challenge_field'] = challenge postData['recaptcha_response_field'] = code + + # Resolve circlecaptcha + if "circlecaptcha" in form: + self.captcha = True + self.logDebug("Captcha protected") + captcha_img_url = "http://ncrypt.in/classes/captcha/circlecaptcha.php" + coords = self.decryptCaptcha(captcha_img_url, forceUser=True, imgtype="png", result_type='positional') + self.logDebug("Captcha resolved, coords [%s]" % str(coords)) + self.captcha_post_url = self.pyfile.url + + postData['circle.x'] = coords[0] + postData['circle.y'] = coords[1] + # Unlock protection postData['submit_protected'] = 'Continue to folder ' @@ -221,4 +235,4 @@ class NCryptIn(Crypter): # Log and return self.logDebug("Block has %d links" % len(links)) - return links \ No newline at end of file + return links -- cgit v1.2.3