diff options
Diffstat (limited to 'module/plugins/crypter/FilecryptCc.py')
-rw-r--r-- | module/plugins/crypter/FilecryptCc.py | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/module/plugins/crypter/FilecryptCc.py b/module/plugins/crypter/FilecryptCc.py index 769877802..341b1e13f 100644 --- a/module/plugins/crypter/FilecryptCc.py +++ b/module/plugins/crypter/FilecryptCc.py @@ -16,7 +16,7 @@ from module.plugins.internal.ReCaptcha import ReCaptcha class FilecryptCc(Crypter): __name__ = "FilecryptCc" __type__ = "crypter" - __version__ = "0.16" + __version__ = "0.17" __pattern__ = r'https?://(?:www\.)?filecrypt\.cc/Container/\w+' @@ -47,36 +47,36 @@ class FilecryptCc(Crypter): if "content notfound" in self.html: #@NOTE: "content notfound" is NOT a typo self.offline() - self.handlePasswordProtection() - self.handleCaptcha() - self.handleMirrorPages() + self.handle_password_protection() + self.handle_captcha() + self.handle_mirror_pages() - for handle in (self.handleCNL, self.handleWeblinks, self.handleDlcContainer): + for handle in (self.handle_CNL, self.handle_weblinks, self.handle_dlc_container): handle() if self.links: self.packages = [(pyfile.package().name, self.links, pyfile.package().name)] return - def handleMirrorPages(self): - if "mirror=" not in self.siteWithLinks: + def handle_mirror_pages(self): + if "mirror=" not in self.site_with_links: return - mirror = re.findall(self.MIRROR_PAGE_PATTERN, self.siteWithLinks) + mirror = re.findall(self.MIRROR_PAGE_PATTERN, self.site_with_links) - self.logInfo(_("Found %d mirrors") % len(mirror)) + self.log_info(_("Found %d mirrors") % len(mirror)) for i in mirror[1:]: - self.siteWithLinks = self.siteWithLinks + self.load(i).decode("utf-8", "replace") + self.site_with_links = self.site_with_links + self.load(i).decode("utf-8", "replace") - def handlePasswordProtection(self): + def handle_password_protection(self): if '<input type="text" name="password"' not in self.html: return - self.logInfo(_("Folder is password protected")) + self.log_info(_("Folder is password protected")) - password = self.getPassword() + password = self.get_password() if not password: self.fail(_("Please enter the password in package section and try again")) @@ -84,26 +84,26 @@ class FilecryptCc(Crypter): self.html = self.load(self.pyfile.url, post={"password": password}) - def handleCaptcha(self): + def handle_captcha(self): m = re.search(self.CAPTCHA_PATTERN, self.html) m2 = re.search(self.CIRCLE_CAPTCHA_PATTERN, self.html) if m: #: normal captcha - self.logDebug("Captcha-URL: %s" % m.group(1)) + self.log_debug("Captcha-URL: %s" % m.group(1)) - captcha_code = self.decryptCaptcha(urlparse.urljoin(self.base_url, m.group(1)), + captcha_code = self.decrypt_captcha(urlparse.urljoin(self.base_url, m.group(1)), forceUser=True, imgtype="gif") - self.siteWithLinks = self.load(self.pyfile.url, + self.site_with_links = self.load(self.pyfile.url, post={'recaptcha_response_field': captcha_code}) elif m2: #: circle captcha - self.logDebug("Captcha-URL: %s" % m2.group(1)) + self.log_debug("Captcha-URL: %s" % m2.group(1)) - captcha_code = self.decryptCaptcha('%s%s?c=abc' %(self.base_url, m2.group(1)), + captcha_code = self.decrypt_captcha('%s%s?c=abc' %(self.base_url, m2.group(1)), result_type='positional') - self.siteWithLinks = self.load(self.pyfile.url, + self.site_with_links = self.load(self.pyfile.url, post={'button.x': captcha_code[0], 'button.y': captcha_code[1]}) else: @@ -112,19 +112,19 @@ class FilecryptCc(Crypter): if captcha_key: response, challenge = recaptcha.challenge(captcha_key) - self.siteWithLinks = self.load(self.pyfile.url, + self.site_with_links = self.load(self.pyfile.url, post={'g-recaptcha-response': response}) else: - self.logInfo(_("No captcha found")) - self.siteWithLinks = self.html + self.log_info(_("No captcha found")) + self.site_with_links = self.html - if "recaptcha_image" in self.siteWithLinks or "data-sitekey" in self.siteWithLinks: - self.invalidCaptcha() + if "recaptcha_image" in self.site_with_links or "data-sitekey" in self.site_with_links: + self.invalid_captcha() self.retry() - def handleDlcContainer(self): - dlc = re.findall(self.DLC_LINK_PATTERN, self.siteWithLinks) + def handle_dlc_container(self): + dlc = re.findall(self.DLC_LINK_PATTERN, self.site_with_links) if not dlc: return @@ -133,9 +133,9 @@ class FilecryptCc(Crypter): self.links.append("%s/DLC/%s.dlc" % (self.base_url, i)) - def handleWeblinks(self): + def handle_weblinks(self): try: - weblinks = re.findall(self.WEBLINK_PATTERN, self.siteWithLinks) + weblinks = re.findall(self.WEBLINK_PATTERN, self.site_with_links) for link in weblinks: res = self.load("%s/Link/%s.html" % (self.base_url, link)) @@ -144,22 +144,22 @@ class FilecryptCc(Crypter): self.links.append(res2['location']) except Exception, e: - self.logDebug("Error decrypting weblinks: %s" % e) + self.log_debug("Error decrypting weblinks: %s" % e) - def handleCNL(self): + def handle_CNL(self): try: - vjk = re.findall('<input type="hidden" name="jk" value="function f\(\){ return \'(.*)\';}">', self.siteWithLinks) - vcrypted = re.findall('<input type="hidden" name="crypted" value="(.*)">', self.siteWithLinks) + vjk = re.findall('<input type="hidden" name="jk" value="function f\(\){ return \'(.*)\';}">', self.site_with_links) + vcrypted = re.findall('<input type="hidden" name="crypted" value="(.*)">', self.site_with_links) for i in xrange(len(vcrypted)): - self.links.extend(self._getLinks(vcrypted[i], vjk[i])) + self.links.extend(self._get_links(vcrypted[i], vjk[i])) except Exception, e: - self.logDebug("Error decrypting CNL: %s" % e) + self.log_debug("Error decrypting CNL: %s" % e) - def _getLinks(self, crypted, jk): + def _get_links(self, crypted, jk): #: Get key key = binascii.unhexlify(str(jk)) |