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

Method decrypt_interactive

module/plugins/internal/Captcha.py:128–161  ·  view source on GitHub ↗
(self, params={}, timeout=120)

Source from the content-addressed store, hash-verified

126 return result
127
128 def decrypt_interactive(self, params={}, timeout=120):
129 captchaManager = self.pyload.captchaManager
130 timeout = max(timeout, 50)
131
132 try:
133 params.update({'captcha_plugin': self.__name__,
134 'plugin': self.pyfile.plugin.__name__})
135 self.task = captchaManager.newTask("interactive", params, "interactive")
136
137 captchaManager.handleCaptcha(self.task, timeout)
138
139 while self.task.isWaiting():
140 self.pyfile.plugin.check_status()
141 time.sleep(1)
142
143 finally:
144 captchaManager.removeTask(self.task)
145
146 result = self.task.result
147
148 if self.task.error:
149 if not self.task.handler and not self.pyload.isClientConnected():
150 self.log_warning(_("No Client connected for captcha decrypting"))
151 self.fail(_("No Client connected for captcha decrypting"))
152 else:
153 self.pyfile.plugin.retry_captcha(msg=self.task.error)
154
155 elif self.task.result:
156 self.log_info(_("Captcha result: `%s`") % (result,))
157
158 else:
159 self.pyfile.plugin.retry_captcha(msg=_("No captcha result obtained in appropriate timing (%ss)") % timeout)
160
161 return result
162
163 def invalid(self, msg=""):
164 if not self.task:

Callers 2

_challenge_v2jsMethod · 0.80
challengeMethod · 0.80

Calls 13

newTaskMethod · 0.80
handleCaptchaMethod · 0.80
isWaitingMethod · 0.80
removeTaskMethod · 0.80
isClientConnectedMethod · 0.80
log_warningMethod · 0.80
log_infoMethod · 0.80
_Function · 0.50
updateMethod · 0.45
check_statusMethod · 0.45
sleepMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected