MCPcopy Index your code
hub / github.com/pyload/pyload / handle_weblinks

Method handle_weblinks

module/plugins/crypter/CriptTo.py:182–216  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

180 return links
181
182 def handle_weblinks(self):
183 links = []
184
185 weblinks = re.findall(self.WEB_LINK_PATTERN, self.data)
186 for weblink in weblinks:
187 html = self.load(weblink)
188 link = self.last_header['url']
189 if link == "https://cript.to/bot":
190 for _i in range(3):
191 url, inputs = parse_html_form("/bot", html)
192 if inputs is None or "circlecaptcha" not in html:
193 continue
194
195 captcha_url = "https://cript.to/captcha/circlecaptcha"
196 captcha_code = self.captcha.decrypt(captcha_url, input_type="png", output_type='positional')
197 inputs['button.x'] = captcha_code[0]
198 inputs['button.y'] = captcha_code[1]
199 html = self.load(url, post=inputs)
200 link = self.last_header['url']
201 if not link.startswith("https://cript.to"):
202 self.captcha.correct()
203 break
204
205 else:
206 self.captcha.invalid()
207
208 else:
209 self.log_warning(_("Could not parse weblink (bot)"))
210 links = []
211 break
212
213 if link:
214 links.append(link)
215
216 return links
217
218 def handle_DLC(self):
219 return [] #: Not yet :(

Callers

nothing calls this directly

Calls 8

parse_html_formFunction · 0.85
log_warningMethod · 0.80
_Function · 0.50
loadMethod · 0.45
decryptMethod · 0.45
correctMethod · 0.45
invalidMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected