summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2015-01-22 21:31:19 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2015-01-22 21:31:19 +0100
commitcf4ded052964047de88d676045329b8fa4fca2dc (patch)
tree5864aad4f34b273044018393b6bb9be690162050 /module/plugins/crypter
parent[CaptchaService] Merge together ReCaptcha versions (diff)
downloadpyload-cf4ded052964047de88d676045329b8fa4fca2dc.tar.xz
Update plugins after CaptchaService changes
Diffstat (limited to 'module/plugins/crypter')
-rw-r--r--module/plugins/crypter/FilecryptCc.py26
-rw-r--r--module/plugins/crypter/MegaCoNzFolder.py2
-rw-r--r--module/plugins/crypter/NCryptIn.py6
-rw-r--r--module/plugins/crypter/RelinkUs.py6
-rw-r--r--module/plugins/crypter/SafelinkingNet.py4
5 files changed, 25 insertions, 19 deletions
diff --git a/module/plugins/crypter/FilecryptCc.py b/module/plugins/crypter/FilecryptCc.py
index 51e6eb296..096fd414d 100644
--- a/module/plugins/crypter/FilecryptCc.py
+++ b/module/plugins/crypter/FilecryptCc.py
@@ -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 ReCaptchaV2
+from module.plugins.internal.CaptchaService import ReCaptcha
class FilecryptCc(Crypter):
__name__ = "FilecryptCc"
__type__ = "crypter"
- __version__ = "0.10"
+ __version__ = "0.11"
__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,15 +108,19 @@ 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:
- self.logInfo(_("No captcha found"))
- self.siteWithLinks = self.html
+ recaptcha = ReCaptcha(self)
+ captcha_key = recaptcha.detect_key()
+
+ if captcha_key:
+ response, challenge = recaptcha.challenge(captcha_key)
+ self.siteWithLinks = self.load(self.pyfile.url,
+ post={'g-recaptcha-response': response},
+ decode=True)
+ else:
+ self.logInfo(_("No captcha found"))
+ self.siteWithLinks = self.html
if "recaptcha_image" in self.siteWithLinks or "data-sitekey" in self.siteWithLinks:
self.invalidCaptcha()
diff --git a/module/plugins/crypter/MegaCoNzFolder.py b/module/plugins/crypter/MegaCoNzFolder.py
index bec4eba22..954bfb9a5 100644
--- a/module/plugins/crypter/MegaCoNzFolder.py
+++ b/module/plugins/crypter/MegaCoNzFolder.py
@@ -29,4 +29,4 @@ class MegaCoNzFolder(Crypter):
self.urls = re.findall(r'(https://mega.co.nz/#N!.+?)<', self.html)
if not self.urls: #@TODO: Remove in 0.4.10
- self.fail("No link grabbed")
+ self.fail(_("No link grabbed"))
diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py
index 7c881ce75..f75f6d484 100644
--- a/module/plugins/crypter/NCryptIn.py
+++ b/module/plugins/crypter/NCryptIn.py
@@ -13,7 +13,7 @@ from module.plugins.internal.CaptchaService import ReCaptcha
class NCryptIn(Crypter):
__name__ = "NCryptIn"
__type__ = "crypter"
- __version__ = "1.33"
+ __version__ = "1.34"
__pattern__ = r'http://(?:www\.)?ncrypt\.in/(?P<TYPE>folder|link|frame)-([^/\?]+)'
__config__ = [("use_subfolder", "bool", "Save package to subfolder", True),
@@ -156,7 +156,7 @@ class NCryptIn(Crypter):
captcha_key = re.search(r'\?k=(.*?)"', form).group(1)
self.logDebug("Resolving ReCaptcha with key [%s]" % captcha_key)
recaptcha = ReCaptcha(self)
- challenge, response = recaptcha.challenge(captcha_key)
+ response, challenge = recaptcha.challenge(captcha_key)
postData['recaptcha_challenge_field'] = challenge
postData['recaptcha_response_field'] = response
@@ -205,7 +205,7 @@ class NCryptIn(Crypter):
elif link_source_type == "web":
return self.handleWebLinks()
else:
- self.error('Unknown source type "%s" (this is probably a bug)' % link_source_type)
+ self.error(_('Unknown source type "%s"') % link_source_type)
def handleSingleLink(self):
diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py
index 0fd80d593..a6014c866 100644
--- a/module/plugins/crypter/RelinkUs.py
+++ b/module/plugins/crypter/RelinkUs.py
@@ -191,7 +191,7 @@ class RelinkUs(Crypter):
elif source == 'web':
return self.handleWEBLinks()
else:
- self.error('Unknown source type "%s" (this is probably a bug)' % source)
+ self.error(_('Unknown source type "%s"') % source)
def handleCNL2Links(self):
@@ -223,8 +223,10 @@ class RelinkUs(Crypter):
with open(dlc_filepath, "wb") as f:
f.write(dlc)
package_links.append(dlc_filepath)
+
except Exception:
- self.fail("Unable to download DLC container")
+ self.fail(_("Unable to download DLC container"))
+
return package_links
diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py
index a56a0a44c..8e46e1e41 100644
--- a/module/plugins/crypter/SafelinkingNet.py
+++ b/module/plugins/crypter/SafelinkingNet.py
@@ -14,7 +14,7 @@ from module.plugins.internal.CaptchaService import SolveMedia
class SafelinkingNet(Crypter):
__name__ = "SafelinkingNet"
__type__ = "crypter"
- __version__ = "0.13"
+ __version__ = "0.14"
__pattern__ = r'https?://(?:www\.)?safelinking\.net/([pd])/\w+'
__config__ = [("use_subfolder", "bool", "Save package to subfolder", True),
@@ -57,7 +57,7 @@ class SafelinkingNet(Crypter):
else:
self.fail(_("Error parsing captcha"))
- challenge, response = captcha.challenge(captchaKey)
+ response, challenge = captcha.challenge(captchaKey)
postData['adcopy_challenge'] = challenge
postData['adcopy_response'] = response