From f5c648f6161ee4075b1b4075be0f4644a94915d6 Mon Sep 17 00:00:00 2001 From: Nitzo Date: Sun, 10 Apr 2016 00:14:40 +0300 Subject: [NitroflareCom] Update --- module/plugins/hoster/NitroflareCom.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'module') diff --git a/module/plugins/hoster/NitroflareCom.py b/module/plugins/hoster/NitroflareCom.py index 3e2970985..68bb3bf04 100644 --- a/module/plugins/hoster/NitroflareCom.py +++ b/module/plugins/hoster/NitroflareCom.py @@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster class NitroflareCom(SimpleHoster): __name__ = "NitroflareCom" __type__ = "hoster" - __version__ = "0.19" + __version__ = "0.20" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?nitroflare\.com/view/(?P[\w^_]+)' @@ -39,18 +39,20 @@ class NitroflareCom(SimpleHoster): def handle_free(self, pyfile): #: Used here to load the cookies which will be required later + self.load("http://nitroflare.com/ajax/setCookie.php", post={'fileId': self.info['pattern']['ID']}) + self.load(pyfile.url, post={'goToFreePage': ""}) - self.load("http://nitroflare.com/ajax/setCookie.php", post={'fileId': self.info['pattern']['ID']}) self.data = self.load("http://nitroflare.com/ajax/freeDownload.php", - post={'method': "startTimer", 'fileId': self.info['pattern']['ID']}) + post={'method': "startTimer", + 'fileId': self.info['pattern']['ID']}) self.check_errors() try: js_file = self.load("http://nitroflare.com/js/downloadFree.js?v=1.0.1") - var_time = re.search("var time = (\\d+);", js_file) - wait_time = int(var_time.groups()[0]) + var_time = re.search(r'var time = (\d+);', js_file).group(1) + wait_time = int(var_time) except Exception: wait_time = 60 @@ -65,4 +67,7 @@ class NitroflareCom(SimpleHoster): 'recaptcha_challenge_field': challenge, 'recaptcha_response_field' : response}) + if "The captcha wasn't entered correctly" in self.data: + self.retry_captcha() + return super(NitroflareCom, self).handle_free(pyfile) -- cgit v1.2.3