Repository navigation
Expand file tree
/
Copy pathCryptCat.py
More file actions
62 lines (41 loc) · 2.04 KB
/
Copy pathCryptCat.py
File metadata and controls
62 lines (41 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# -*- coding: utf-8 -*-
import re
from module.plugins.internal.SimpleCrypter import SimpleCrypter
class CryptCat(SimpleCrypter):
__name__ = "CryptCat"
__type__ = "crypter"
__version__ = "0.03"
__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):
baseurl = self.req.http.lastEffectiveURL
url, inputs = self.parse_html_form()
if ">Enter your password.<" in self.data:
password = self.get_password()
if not password:
self.fail(_("Password required"))
inputs['Pass1'] = password
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")
inputs['security_code'] = captcha_code
else:
return []
else:
return []
self.data = self.load(baseurl, post=inputs, ref=baseurl)
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)