MCPcopy
hub / github.com/pyload/pyload / getCaptchaTask

Method getCaptchaTask

module/Api.py:798–812  ·  view source on GitHub ↗

Returns a captcha task :param exclusive: unused :return: `CaptchaTask`

(self, exclusive=False)

Source from the content-addressed store, hash-verified

796
797 @permission(PERMS.STATUS)
798 def getCaptchaTask(self, exclusive=False):
799 """Returns a captcha task
800
801 :param exclusive: unused
802 :return: `CaptchaTask`
803 """
804 self.core.lastClientConnected = time()
805 task = self.core.captchaManager.getTask()
806 if task:
807 task.setWatingForUser(exclusive=exclusive)
808 data, type, result = task.getCaptcha()
809 t = CaptchaTask(int(task.id), json.dumps(data), type, result)
810 return t
811 else:
812 return CaptchaTask(-1)
813
814 @permission(PERMS.STATUS)
815 def getCaptchaTaskStatus(self, tid):

Callers 1

checkCaptchaMethod · 0.45

Calls 4

getTaskMethod · 0.80
setWatingForUserMethod · 0.80
getCaptchaMethod · 0.80
CaptchaTaskClass · 0.70

Tested by

no test coverage detected