[^\)]+)\)\s*"
FILE_NAME_PATTERN = r'/download/redirect/[^"\']+)'
LIMIT_WAIT_PATTERN = r'\s*.*?(\d+) seconds'
def handleFree(self):
self.url = "http://turbobit.net/download/free/%s" % self.file_info['ID']
self.html = self.load(self.url)
found = re.search(self.CAPTCHA_KEY_PATTERN, self.html)
captcha_key = found.group(1) if found else '6LcTGLoSAAAAAHCWY9TTIrQfjUlxu6kZlTYP50_c'
recaptcha = ReCaptcha(self)
for i in range(5):
found = re.search(self.LIMIT_WAIT_PATTERN, self.html)
if found:
self.setWait(int(found.group(1)), True)
self.wait()
self.retry()
action, inputs = self.parseHtmlForm("action='#'")
inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge(captcha_key)
if not inputs: self.parseError("inputs")
self.logDebug(inputs)
self.html = self.load(self.url, post = inputs)
if not "