def handle_free(self, pyfile):
self.req.http.lastURL = pyfile.url
self.req.http.c.setopt(
pycurl.HTTPHEADER,
["X-Requested-With: XMLHttpRequest"])
jsvars = self.get_json_response("https://rapidu.net/ajax.php",
get={'a': "getLoadTimeToDownload"},
post={'_go': ""})
if str(jsvars['timeToDownload']) == "stop":
t = (24 * 60 * 60) - (int(time.time()) %
(24 * 60 * 60)) + time.altzone
self.log_info(_("You've reach your daily download transfer"))
# @NOTE: check t in case of not synchronised clock
self.retry(10, 10 if t < 1 else None, _("Try tomorrow again"))
else:
self.wait(int(jsvars['timeToDownload']) - int(time.time()))
self.captcha = ReCaptcha(pyfile)
response, challenge = self.captcha.challenge(self.RECAPTCHA_KEY)
jsvars = self.get_json_response("https://rapidu.net/ajax.php",
get={'a': "getCheckCaptcha"},
post={'_go': "",
'captcha1': challenge,
'captcha2': response,
'fileId': self.info['pattern']['ID']})
if jsvars['message'] == "success":
self.link = jsvars['url']
评论列表
文章目录