summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar Nitzo <nitzo2001@yahoo.com> 2016-03-20 23:23:20 +0100
committerGravatar Nitzo <nitzo2001@yahoo.com> 2016-03-20 23:23:20 +0100
commita951196c06da7b288b244944e4ae8026b4c658d9 (patch)
tree2530350efb0e182aeec697901678dde609ab6c62 /module
parent[UpdateManager] issue #2377 (diff)
downloadpyload-a951196c06da7b288b244944e4ae8026b4c658d9.tar.xz
[New Cypter] CryptCat - fix #2273
Diffstat (limited to 'module')
-rw-r--r--module/plugins/crypter/CryptCat.py61
1 files changed, 61 insertions, 0 deletions
diff --git a/module/plugins/crypter/CryptCat.py b/module/plugins/crypter/CryptCat.py
new file mode 100644
index 000000000..737592b18
--- /dev/null
+++ b/module/plugins/crypter/CryptCat.py
@@ -0,0 +1,61 @@
+# -*- coding: utf-8 -*-
+
+import re
+
+from module.plugins.internal.SimpleCrypter import SimpleCrypter
+
+
+class CryptCat(SimpleCrypter):
+ __name__ = "CryptCat"
+ __type__ = "crypter"
+ __version__ = "0.01"
+ __status__ = "testing"
+
+ __pattern__ = r'https?://(?:www\.)?crypt\.cat/\w+'
+ __config__ = [("activated" , "bool" , "Activated" , True ),
+ ("use_premium" , "bool" , "Use premium account if available" , True ),
+ ("folder_per_package", "Default;Yes;No", "Create folder for each package" , "Default"),
+ ("max_wait" , "int" , "Reconnect if waiting time is greater than minutes", 10 )]
+
+ __description__ = """crypt.cat decrypter plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("GammaC0de", "nitzo2001[AT]yahoo[DOT]com")]
+
+
+ OFFLINE_PATTERN = r'Folder not available!'
+
+ LINK_PATTERN = r'<input .+?readonly="" value="\s*(.+?)" type="text">'
+
+
+ def get_links(self):
+ url = self.req.http.lastEffectiveURL
+
+ if ">Enter your password.<" in self.data:
+ password = self.get_password()
+ if not password:
+ self.fail(_("Password required"))
+
+ post_data = {'Pass1' : password,
+ 'Submit0' : "" }
+
+ elif "Enter Captcha" in self.data:
+ m = re.search(r'<img src="(.+?)"', self.data)
+ if m:
+ captcha_code = self.captcha.decrypt(m.group(1), input_type="jpeg")
+ post_data = {'security_code' : captcha_code,
+ 'submit1' : "" }
+ else:
+ return []
+
+ else:
+ return []
+
+ self.data = self.load(url, post=post_data, ref=url)
+
+ if "You have entered an incorrect password." in self.data:
+ self.fail(_("Wrong password"))
+
+ elif "Your filled the captcha wrongly!" in self.data:
+ self.retry_captcha()
+
+ return re.findall(self.LINK_PATTERN, self.data)