MCPcopy
hub / github.com/pyload/pyload / get_links

Method get_links

module/plugins/crypter/CryptCat.py:29–61  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

27 LINK_PATTERN = r'<input .+?readonly="" value="\s*(.+?)" type="text">'
28
29 def get_links(self):
30 baseurl = self.req.http.lastEffectiveURL
31 url, inputs = self.parse_html_form()
32
33 if ">Enter your password.<" in self.data:
34 password = self.get_password()
35 if not password:
36 self.fail(_("Password required"))
37
38 inputs['Pass1'] = password
39
40 elif "Enter Captcha" in self.data:
41 m = re.search(r'<img src="(.+?)"', self.data)
42 if m is not None:
43 captcha_code = self.captcha.decrypt(
44 m.group(1), input_type="jpeg")
45 inputs['security_code'] = captcha_code
46
47 else:
48 return []
49
50 else:
51 return []
52
53 self.data = self.load(baseurl, post=inputs, ref=baseurl)
54
55 if "You have entered an incorrect password." in self.data:
56 self.fail(_("Wrong password"))
57
58 elif "Your filled the captcha wrongly!" in self.data:
59 self.retry_captcha()
60
61 return re.findall(self.LINK_PATTERN, self.data)

Callers

nothing calls this directly

Calls 8

parse_html_formMethod · 0.80
get_passwordMethod · 0.80
_Function · 0.50
failMethod · 0.45
searchMethod · 0.45
decryptMethod · 0.45
loadMethod · 0.45
retry_captchaMethod · 0.45

Tested by

no test coverage detected