From 5203917e9c1a84c1a86796146eed2572d0c30f94 Mon Sep 17 00:00:00 2001 From: zapp-brannigan Date: Wed, 14 Jan 2015 12:43:54 +0100 Subject: [FilecryptCc.py] Added support for ReCaptchaV2 Fix for https://github.com/pyload/pyload/issues/976 --- module/plugins/crypter/FilecryptCc.py | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'module/plugins/crypter') diff --git a/module/plugins/crypter/FilecryptCc.py b/module/plugins/crypter/FilecryptCc.py index af31dc743..51e6eb296 100644 --- a/module/plugins/crypter/FilecryptCc.py +++ b/module/plugins/crypter/FilecryptCc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- - +# http://filecrypt.cc/Container/64E039F859.html import base64 import binascii import re @@ -8,13 +8,13 @@ from Crypto.Cipher import AES from urlparse import urljoin from module.plugins.Crypter import Crypter -from module.plugins.internal.CaptchaService import ReCaptcha +from module.plugins.internal.CaptchaService import ReCaptchaV2 class FilecryptCc(Crypter): __name__ = "FilecryptCc" __type__ = "crypter" - __version__ = "0.09" + __version__ = "0.10" __pattern__ = r'https?://(?:www\.)?filecrypt\.cc/Container/\w+' @@ -74,7 +74,7 @@ class FilecryptCc(Crypter): self.logInfo(_("Folder is password protected")) password = self.getPassword() - + if not password: self.fail(_("Please enter the password in package section and try again")) @@ -108,20 +108,17 @@ class FilecryptCc(Crypter): post={'button.x': captcha_code[0], 'button.y': captcha_code[1]}, cookies=True, decode=True) + + elif 'class="g-recaptcha"' in self.html: #: ReCaptchaV2 + captcha = ReCaptchaV2(self) + response = captcha.doTheCaptcha(self.pyfile.url.split("/")[2]) + self.siteWithLinks = self.load(self.pyfile.url, cookies=True, decode=True, post={"g-recaptcha-response":response}) + else: - recaptcha = ReCaptcha(self) - captcha_key = recaptcha.detect_key() - - if captcha_key: - self.siteWithLinks = self.load(self.pyfile.url, - post={'g-recaptcha-response': recaptcha.challenge(captcha_key, True)}, - cookies=True, - decode=True) - else: - self.logDebug("No captcha found") - self.siteWithLinks = self.html - - if "recaptcha_image" in self.siteWithLinks: + self.logInfo(_("No captcha found")) + self.siteWithLinks = self.html + + if "recaptcha_image" in self.siteWithLinks or "data-sitekey" in self.siteWithLinks: self.invalidCaptcha() self.retry() -- cgit v1.2.3