From 3b8330037e09edd5f1d7475a4b176131f89bcd41 Mon Sep 17 00:00:00 2001 From: Sahil Shekhawat Date: Tue, 6 Jan 2015 00:00:26 +0530 Subject: Created plugin for Nitroflare.com --- module/plugins/hoster/NitroflareCom.py | 86 ++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 module/plugins/hoster/NitroflareCom.py (limited to 'module/plugins/hoster/NitroflareCom.py') diff --git a/module/plugins/hoster/NitroflareCom.py b/module/plugins/hoster/NitroflareCom.py new file mode 100644 index 000000000..c31431cc2 --- /dev/null +++ b/module/plugins/hoster/NitroflareCom.py @@ -0,0 +1,86 @@ +# -*- coding: utf-8 -*- + +import re +import json + +from module.plugins.Hoster import Hoster +from module.plugins.internal.CaptchaService import ReCaptcha + + +""" + Right now premium support is not added + Thus, any file that require premium support + cannot be downloaded. Only the file that is free to + download can be downloaded. +""" +class NitroflareCom(Hoster): + __name__ = "NitroflareCom" + __type__ = "hoster" + __version__ = "0.01" + + __pattern__ = r'https?://(?:www\.)?(nitroflare\.com/view)/(?P[A-Z0-9]+)' + __description__ = """Nitroflare.com hoster plugin""" + __license__ = "GPLv3" + __authors__ = [("sahil", None)] + + BASE_URL = "https://nitroflare.com" + API_URL = "https://nitroflare.com/api/" + DOWNLOAD_PATTERN = "\"(https?://[a-z0-9\\-_]+\\.nitroflare\\.com/[^<>\"]*?)\"" + + def process(self, pyfile): + + if "https://" not in pyfile.url: + pyfile.url = self.correct_download_link(pyfile.url) + + url_match = re.match(self.__pattern__, pyfile.url) + file_uid = url_match.group('ID') + if self.checkLink(file_uid): + file_info = self.load(self.API_URL + "getDownloadLink?file=" + file_uid) + self.logWarning(file_info[3:]) + file_info = json.loads(file_info[3:]) # removing non ascii characters + if file_info['type'] == "success": + result = file_info['result'] # already a dict + if result['linkType'] == "free": + delay = result['delay'] # Don't need the delay for free downloads + captch_key = result['recaptchaPublic'] + filename = result['name'] + recaptcha = ReCaptcha(self) + # try upto 3 times to solve reCaptcha + for i in xrange(3): + challenge, response = recaptcha.challenge(key=captch_key) + res = self.load(self.BASE_URL + "/ajax/freeDownload.php", + post={"method": "fetchDownload", + "recaptcha_challenge_field": challenge, + "recaptcha_response_field": response}) + if self.handleCaptchaErrors(res): + break + if "The captcha wasn't entered correctly" or "You have to fill the captcha" in res: + continue + else: + break + + if "The captcha wasn't entered correctly" or "You have to fill the captcha" in res: + self.logError("Captcha Failed") + self.offline() + # Captcha failed + else: + self.logInfo("result of the captcha is") + self.logInfo(res) + # self.offline() + download_link = re.search(self.DOWNLOAD_PATTERN, res) + if download_link is None: + print "downloasd link failed" + # Download link failed + else: + self.download(download_link) + else: + print "link is invalid" + self.offline() + # Link is invalid + # self.download() + + def correct_download_link(self, url): + return url.replace("http://", "https://") + + def checkLink(self, url): + return True \ No newline at end of file -- cgit v1.2.3 From fd105f8e51768ec1943cda2375bdfdbe5b0a3951 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 9 Jan 2015 00:35:51 +0100 Subject: "New Year" Update: hoster plugins --- module/plugins/hoster/NitroflareCom.py | 123 ++++++++++++++++----------------- 1 file changed, 58 insertions(+), 65 deletions(-) (limited to 'module/plugins/hoster/NitroflareCom.py') diff --git a/module/plugins/hoster/NitroflareCom.py b/module/plugins/hoster/NitroflareCom.py index c31431cc2..6356da428 100644 --- a/module/plugins/hoster/NitroflareCom.py +++ b/module/plugins/hoster/NitroflareCom.py @@ -1,86 +1,79 @@ # -*- coding: utf-8 -*- +# +# Note: +# Right now premium support is not added +# Thus, any file that require premium support +# cannot be downloaded. Only the file that is free to +# download can be downloaded. import re -import json -from module.plugins.Hoster import Hoster +from module.common.json_layer import json_loads from module.plugins.internal.CaptchaService import ReCaptcha +from module.plugins.SimpleHoster import SimpleHoster -""" - Right now premium support is not added - Thus, any file that require premium support - cannot be downloaded. Only the file that is free to - download can be downloaded. -""" -class NitroflareCom(Hoster): - __name__ = "NitroflareCom" - __type__ = "hoster" - __version__ = "0.01" +class NitroflareCom(SimpleHoster): + __name__ = "NitroflareCom" + __type__ = "hoster" + __version__ = "0.02" + + __pattern__ = r'https?://(?:www\.)?nitroflare\.com/view/(?P[\w^_]+)' - __pattern__ = r'https?://(?:www\.)?(nitroflare\.com/view)/(?P[A-Z0-9]+)' __description__ = """Nitroflare.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("sahil", None)] + __license__ = "GPLv3" + __authors__ = [("sahil", ""), + ("Walter Purcaro", "vuolter@gmail.com")] + - BASE_URL = "https://nitroflare.com" - API_URL = "https://nitroflare.com/api/" - DOWNLOAD_PATTERN = "\"(https?://[a-z0-9\\-_]+\\.nitroflare\\.com/[^<>\"]*?)\"" + # URL_REPLACEMENTS = [("http://", "https://")] - def process(self, pyfile): + LINK_FREE_PATTERN = r'(https?://[\w\\-]+\\.nitroflare\\.com/[^<>\"]*?)"' - if "https://" not in pyfile.url: - pyfile.url = self.correct_download_link(pyfile.url) - url_match = re.match(self.__pattern__, pyfile.url) - file_uid = url_match.group('ID') - if self.checkLink(file_uid): - file_info = self.load(self.API_URL + "getDownloadLink?file=" + file_uid) - self.logWarning(file_info[3:]) - file_info = json.loads(file_info[3:]) # removing non ascii characters - if file_info['type'] == "success": - result = file_info['result'] # already a dict - if result['linkType'] == "free": - delay = result['delay'] # Don't need the delay for free downloads - captch_key = result['recaptchaPublic'] - filename = result['name'] - recaptcha = ReCaptcha(self) - # try upto 3 times to solve reCaptcha - for i in xrange(3): - challenge, response = recaptcha.challenge(key=captch_key) - res = self.load(self.BASE_URL + "/ajax/freeDownload.php", - post={"method": "fetchDownload", - "recaptcha_challenge_field": challenge, - "recaptcha_response_field": response}) - if self.handleCaptchaErrors(res): - break - if "The captcha wasn't entered correctly" or "You have to fill the captcha" in res: - continue - else: - break + def handleFree(self, pyfile): + file_info = self.load("https://nitroflare.com/api/getDownloadLink", + get={'file': self.info['pattern']['ID']}) + self.logWarning(file_info[3:]) + file_info = json_loads(file_info[3:]) # removing non ascii characters + if file_info['type'] == "success": + result = file_info['result'] # already a dict + if result['linkType'] == "free": + delay = result['delay'] # Don't need the delay for free downloads + captch_key = result['recaptchaPublic'] + filename = result['name'] + recaptcha = ReCaptcha(self) + # try upto 3 times to solve reCaptcha + for i in xrange(3): + challenge, response = recaptcha.challenge(key=captch_key) + res = self.load("https://nitroflare.com/ajax/freeDownload.php", + post={"method": "fetchDownload", + "recaptcha_challenge_field": challenge, + "recaptcha_response_field": response}) + if self.handleCaptchaErrors(res): + break if "The captcha wasn't entered correctly" or "You have to fill the captcha" in res: - self.logError("Captcha Failed") - self.offline() - # Captcha failed + continue + else: + break + + if "The captcha wasn't entered correctly" or "You have to fill the captcha" in res: + self.logError("Captcha Failed") + self.offline() + # Captcha failed + else: + self.logInfo("result of the captcha is") + self.logInfo(res) + # self.offline() + download_link = re.search(self.DOWNLOAD_PATTERN, res) + if download_link is None: + print "downloasd link failed" + # Download link failed else: - self.logInfo("result of the captcha is") - self.logInfo(res) - # self.offline() - download_link = re.search(self.DOWNLOAD_PATTERN, res) - if download_link is None: - print "downloasd link failed" - # Download link failed - else: - self.download(download_link) + self.download(download_link) else: print "link is invalid" self.offline() # Link is invalid # self.download() - - def correct_download_link(self, url): - return url.replace("http://", "https://") - - def checkLink(self, url): - return True \ No newline at end of file -- cgit v1.2.3 From b2d6eb15db1f50428801c6e63c64de4675db6f78 Mon Sep 17 00:00:00 2001 From: Sahil Shekhawat Date: Sun, 11 Jan 2015 19:06:09 +0530 Subject: updated nitroflare.com's plugin --- module/plugins/hoster/NitroflareCom.py | 90 ++++++++++++++++++++-------------- 1 file changed, 54 insertions(+), 36 deletions(-) (limited to 'module/plugins/hoster/NitroflareCom.py') diff --git a/module/plugins/hoster/NitroflareCom.py b/module/plugins/hoster/NitroflareCom.py index c31431cc2..5b535591a 100644 --- a/module/plugins/hoster/NitroflareCom.py +++ b/module/plugins/hoster/NitroflareCom.py @@ -3,20 +3,15 @@ import re import json +from time import sleep from module.plugins.Hoster import Hoster from module.plugins.internal.CaptchaService import ReCaptcha -""" - Right now premium support is not added - Thus, any file that require premium support - cannot be downloaded. Only the file that is free to - download can be downloaded. -""" class NitroflareCom(Hoster): __name__ = "NitroflareCom" __type__ = "hoster" - __version__ = "0.01" + __version__ = "0.13" __pattern__ = r'https?://(?:www\.)?(nitroflare\.com/view)/(?P[A-Z0-9]+)' __description__ = """Nitroflare.com hoster plugin""" @@ -26,6 +21,8 @@ class NitroflareCom(Hoster): BASE_URL = "https://nitroflare.com" API_URL = "https://nitroflare.com/api/" DOWNLOAD_PATTERN = "\"(https?://[a-z0-9\\-_]+\\.nitroflare\\.com/[^<>\"]*?)\"" + IS_FREE = True + PREMIUM_URL = BASE_URL + "/payment" def process(self, pyfile): @@ -41,46 +38,67 @@ class NitroflareCom(Hoster): if file_info['type'] == "success": result = file_info['result'] # already a dict if result['linkType'] == "free": - delay = result['delay'] # Don't need the delay for free downloads + delay = int(result['delay']) captch_key = result['recaptchaPublic'] filename = result['name'] recaptcha = ReCaptcha(self) - # try upto 3 times to solve reCaptcha - for i in xrange(3): - challenge, response = recaptcha.challenge(key=captch_key) - res = self.load(self.BASE_URL + "/ajax/freeDownload.php", - post={"method": "fetchDownload", - "recaptcha_challenge_field": challenge, - "recaptcha_response_field": response}) - if self.handleCaptchaErrors(res): - break - if "The captcha wasn't entered correctly" or "You have to fill the captcha" in res: - continue - else: - break + main_page = self.load(pyfile.url) + go_to_free_page = self.load(pyfile.url, + post={"goToFreePage": ""}) + # challenge, response = recaptcha.challenge(key=captch_key) + res = self.load(self.BASE_URL + "/ajax/freeDownload.php", + post={"method": "startTimer", + "fileId": file_uid})[4:] - if "The captcha wasn't entered correctly" or "You have to fill the captcha" in res: - self.logError("Captcha Failed") - self.offline() - # Captcha failed + if "This file is available with premium key only" in res: + self.fail("This file is available with premium key only") + if "downloading is not possible" in res: + wait_time = re.search("You have to wait (\\d+) minutes to download your next file", res) + if wait_time is not None: + self.fail("IP Address blocked") + self.fail("Downloading is not possible") else: - self.logInfo("result of the captcha is") self.logInfo(res) - # self.offline() - download_link = re.search(self.DOWNLOAD_PATTERN, res) + js_file = self.load(self.BASE_URL + "/js/downloadFree.js?v=1.0.1") + var_time = re.search("var time = (\\d+);", js_file) + wait = 60 + if var_time is not None: + wait = int(var_time.groups()[0]) + self.setWait(wait) + self.wait() + for i in xrange(3): + challenge, response = recaptcha.challenge(key=captch_key) + res_final = self.load(self.BASE_URL + "/ajax/freeDownload.php", + post={"method": "fetchDownload", + "recaptcha_challenge_field": challenge, + "recaptcha_response_field": response})[3:] + self.logInfo(res_final) + + if self.handleCaptchaErrors(res_final): + break + if "The captcha wasn't entered correctly" or "You have to fill the captcha" in res_final: + continue + else: + break + download_link = re.search(self.DOWNLOAD_PATTERN, res_final) if download_link is None: - print "downloasd link failed" - # Download link failed + self.fail("Could not find a download link. Please check the download link again") else: - self.download(download_link) + try: + self.download(download_link) + except: + self.fail("Downloading failed") else: - print "link is invalid" - self.offline() - # Link is invalid - # self.download() + self.fail("Link is not valid. Please check the link again") def correct_download_link(self, url): return url.replace("http://", "https://") def checkLink(self, url): - return True \ No newline at end of file + return True + + def handle_api(self, download_url, account): + handle_downloadAPI(download_url, account) + + def enable_premium(self, url): + self.IS_FREE = False # To try premium -- cgit v1.2.3 From a56bab2d473edaf3a83ea30222d4b01558d814ff Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 11 Jan 2015 19:51:54 +0100 Subject: [NitroflareCom] Fix bad import --- module/plugins/hoster/NitroflareCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/NitroflareCom.py') diff --git a/module/plugins/hoster/NitroflareCom.py b/module/plugins/hoster/NitroflareCom.py index 6356da428..2367493e5 100644 --- a/module/plugins/hoster/NitroflareCom.py +++ b/module/plugins/hoster/NitroflareCom.py @@ -10,13 +10,13 @@ import re from module.common.json_layer import json_loads from module.plugins.internal.CaptchaService import ReCaptcha -from module.plugins.SimpleHoster import SimpleHoster +from module.plugins.internal.SimpleHoster import SimpleHoster class NitroflareCom(SimpleHoster): __name__ = "NitroflareCom" __type__ = "hoster" - __version__ = "0.02" + __version__ = "0.03" __pattern__ = r'https?://(?:www\.)?nitroflare\.com/view/(?P[\w^_]+)' -- cgit v1.2.3 From 2e919240585ee5ba87aa55df87db4f19118ffcbb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 18 Jan 2015 17:57:25 +0100 Subject: [NitroflareCom] Update --- module/plugins/hoster/NitroflareCom.py | 138 ++++++++++++++++----------------- 1 file changed, 66 insertions(+), 72 deletions(-) (limited to 'module/plugins/hoster/NitroflareCom.py') diff --git a/module/plugins/hoster/NitroflareCom.py b/module/plugins/hoster/NitroflareCom.py index fdbcf0e64..caae2f8b0 100644 --- a/module/plugins/hoster/NitroflareCom.py +++ b/module/plugins/hoster/NitroflareCom.py @@ -16,7 +16,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster class NitroflareCom(SimpleHoster): __name__ = "NitroflareCom" __type__ = "hoster" - __version__ = "0.04" + __version__ = "0.05" __pattern__ = r'https?://(?:www\.)?nitroflare\.com/view/(?P[\w^_]+)' @@ -25,82 +25,76 @@ class NitroflareCom(SimpleHoster): __authors__ = [("sahil", "sahilshekhawat01@gmail.com"), ("Walter Purcaro", "vuolter@gmail.com")] - BASE_URL = "https://nitroflare.com" - API_URL = "https://nitroflare.com/api/" - DOWNLOAD_PATTERN = "\"(https?://[a-z0-9\\-_]+\\.nitroflare\\.com/[^<>\"]*?)\"" - IS_FREE = True - PREMIUM_URL = BASE_URL + "/payment" + # URL_REPLACEMENTS = [("http://", "https://")] + + INFO_PATTERN = r'title="(?P.+?)".+>(?P[\d.,]+) (?P[\w^_]+)' + OFFLINE_PATTERN = r'>File doesn\'t exist' + + LINK_FREE_PATTERN = r'(https?://[\w\\-]+\\.nitroflare\\.com/.+?)"' - LINK_FREE_PATTERN = r'(https?://[\w\\-]+\\.nitroflare\\.com/[^<>\"]*?)"' def handleFree(self, pyfile): - if self.checkLink(file_uid): - file_info = self.load("https://nitroflare.com/api/getDownloadLink", - get={'file': self.info['pattern']['ID']}) - self.logWarning(file_info[3:]) - file_info = json_loads(file_info[3:]) # removing non ascii characters - if file_info['type'] == "success": - result = file_info['result'] # already a dict - if result['linkType'] == "free": - delay = int(result['delay']) - captch_key = result['recaptchaPublic'] - filename = result['name'] - recaptcha = ReCaptcha(self) - # used here to load the cookies which will be required later - main_page = self.load(pyfile.url) - go_to_free_page = self.load(pyfile.url, - post={"goToFreePage": ""}) - # challenge, response = recaptcha.challenge(key=captch_key) - res = self.load(self.BASE_URL + "/ajax/freeDownload.php", - post={"method": "startTimer", - "fileId": file_uid})[4:] - - if "This file is available with premium key only" in res: - self.fail("This file is available with premium key only") - if "downloading is not possible" in res: - wait_time = re.search("You have to wait (\\d+) minutes to download your next file", res) - if wait_time is not None: - self.fail("IP Address blocked") - self.fail("Downloading is not possible") - else: - self.logInfo(res) - js_file = self.load(self.BASE_URL + "/js/downloadFree.js?v=1.0.1") - var_time = re.search("var time = (\\d+);", js_file) - wait = 60 - if var_time is not None: - wait = int(var_time.groups()[0]) - self.setWait(wait) - self.wait() - for i in xrange(3): - challenge, response = recaptcha.challenge(key=captch_key) - res_final = self.load(self.BASE_URL + "/ajax/freeDownload.php", - post={"method": "fetchDownload", - "recaptcha_challenge_field": challenge, - "recaptcha_response_field": response})[3:] - self.logInfo(res_final) - - if self.handleCaptchaErrors(res_final): - break - if "The captcha wasn't entered correctly" or "You have to fill the captcha" in res_final: - continue - else: - break - download_link = re.search(self.DOWNLOAD_PATTERN, res_final) - if download_link is None: - self.fail("Could not find a download link. Please check the download link again") - else: - self.download(download_link) + file_info = self.load("https://nitroflare.com/api/getDownloadLink", + get={'file': self.info['pattern']['ID']}) + + self.logDebug(file_info[3:]) + + file_info = json_loads(file_info[3:]) #: removing non ascii characters + if file_info['type'] != "success": + return + + result = file_info['result'] #: already a dict + if result['linkType'] != "free": + return + + # delay = int(result['delay']) + captcha_key = result['recaptchaPublic'] + filename = result['name'] + recaptcha = ReCaptcha(self) + + # used here to load the cookies which will be required later + self.load(pyfile.url) + self.load(pyfile.url, post={'goToFreePage': ""}) + + self.html = self.load("http://nitroflare.com/ajax/freeDownload.php", + post={'method': "startTimer", 'fileId': self.info['pattern']['ID']})[4:] + + if "This file is available with premium key only" in self.html: + self.fail("This file is available with premium key only") + + elif "downloading is not possible" in self.html: + wait_time = re.search("You have to wait (\\d+) minutes to download your next file", self.html) + if wait_time: + self.wait(wait_time, True) + else: + self.fail("Downloading is not possible") + else: - self.fail("Link is not valid. Please check the link again") + self.logDebug(self.html) + + 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]) + + except Exception: + wait_time = 60 + + self.wait(wait_time) + + challenge, response = recaptcha.challenge(captcha_key) + + self.html = self.load("http://nitroflare.com/ajax/freeDownload.php", + post={'method' : "fetchDownload", + 'recaptcha_challenge_field': challenge, + 'recaptcha_response_field' : response})[3:] - def correct_download_link(self, url): - return url.replace("http://", "https://") + self.logDebug(self.html) - def checkLink(self, url): - return True + if "The captcha wasn't entered correctly" in self.html + return - def handle_api(self, download_url, account): - handle_downloadAPI(download_url, account) + if "You have to fill the captcha" in self.html: + return - def enable_premium(self, url): - self.IS_FREE = False # To try premium \ No newline at end of file + self.link = re.search(self.LINK_FREE_PATTERN, self.html) -- cgit v1.2.3 From 34708f50136011c0db69115f498f6f14e2f5adf5 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 18 Jan 2015 18:27:21 +0100 Subject: [NitroflareCom] Update (2) --- module/plugins/hoster/NitroflareCom.py | 93 +++++++++++++++++----------------- 1 file changed, 46 insertions(+), 47 deletions(-) (limited to 'module/plugins/hoster/NitroflareCom.py') diff --git a/module/plugins/hoster/NitroflareCom.py b/module/plugins/hoster/NitroflareCom.py index caae2f8b0..722fb6eaf 100644 --- a/module/plugins/hoster/NitroflareCom.py +++ b/module/plugins/hoster/NitroflareCom.py @@ -16,7 +16,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster class NitroflareCom(SimpleHoster): __name__ = "NitroflareCom" __type__ = "hoster" - __version__ = "0.05" + __version__ = "0.06" __pattern__ = r'https?://(?:www\.)?nitroflare\.com/view/(?P[\w^_]+)' @@ -30,71 +30,70 @@ class NitroflareCom(SimpleHoster): INFO_PATTERN = r'title="(?P.+?)".+>(?P[\d.,]+) (?P[\w^_]+)' OFFLINE_PATTERN = r'>File doesn\'t exist' - LINK_FREE_PATTERN = r'(https?://[\w\\-]+\\.nitroflare\\.com/.+?)"' + LINK_FREE_PATTERN = r'(https?://[\w\-]+\.nitroflare\.com/.+?)"' + PREMIUM_ONLY_PATTERN = r'This file is available with Premium only' + WAIT_PATTERN = r'You have to wait .+?<' + ERROR_PATTERN = r'downloading is not possible' - def handleFree(self, pyfile): - file_info = self.load("https://nitroflare.com/api/getDownloadLink", - get={'file': self.info['pattern']['ID']}) - - self.logDebug(file_info[3:]) - file_info = json_loads(file_info[3:]) #: removing non ascii characters - if file_info['type'] != "success": + def checkErrors(self): + if not self.html: return - result = file_info['result'] #: already a dict - if result['linkType'] != "free": - return + if not self.premium and re.search(self.PREMIUM_ONLY_PATTERN, self.html): + self.fail(_("Link require a premium account to be handled")) + + elif hasattr(self, 'WAIT_PATTERN'): + m = re.search(self.WAIT_PATTERN, self.html) + if m: + wait_time = sum([int(v) * {"hr": 3600, "hour": 3600, "min": 60, "sec": 1}[u.lower()] for v, u in + re.findall(r'(\d+)\s*(hr|hour|min|sec)', m.group(0), re.I)]) + self.wait(wait_time, wait_time > 300) + return + + elif hasattr(self, 'ERROR_PATTERN'): + m = re.search(self.ERROR_PATTERN, self.html) + if m: + errmsg = self.info['error'] = m.group(1) + self.error(errmsg) - # delay = int(result['delay']) - captcha_key = result['recaptchaPublic'] - filename = result['name'] - recaptcha = ReCaptcha(self) + self.info.pop('error', None) + + def handleFree(self, pyfile): # used here to load the cookies which will be required later - self.load(pyfile.url) self.load(pyfile.url, post={'goToFreePage': ""}) self.html = self.load("http://nitroflare.com/ajax/freeDownload.php", post={'method': "startTimer", 'fileId': self.info['pattern']['ID']})[4:] - if "This file is available with premium key only" in self.html: - self.fail("This file is available with premium key only") + self.checkErrors() - elif "downloading is not possible" in self.html: - wait_time = re.search("You have to wait (\\d+) minutes to download your next file", self.html) - if wait_time: - self.wait(wait_time, True) - else: - self.fail("Downloading is not possible") + 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]) - else: - self.logDebug(self.html) + except Exception: + wait_time = 60 - 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]) + self.wait(wait_time) - except Exception: - wait_time = 60 + recaptcha = ReCaptcha(self) + challenge, response = recaptcha.challenge("6Lenx_USAAAAAF5L1pmTWvWcH73dipAEzNnmNLgy") - self.wait(wait_time) - - challenge, response = recaptcha.challenge(captcha_key) - - self.html = self.load("http://nitroflare.com/ajax/freeDownload.php", - post={'method' : "fetchDownload", - 'recaptcha_challenge_field': challenge, - 'recaptcha_response_field' : response})[3:] + self.html = self.load("http://nitroflare.com/ajax/freeDownload.php", + post={'method' : "fetchDownload", + 'recaptcha_challenge_field': challenge, + 'recaptcha_response_field' : response})[3:] - self.logDebug(self.html) + self.logDebug(self.html) - if "The captcha wasn't entered correctly" in self.html - return + if "The captcha wasn't entered correctly" in self.html: + return - if "You have to fill the captcha" in self.html: - return + if "You have to fill the captcha" in self.html: + return - self.link = re.search(self.LINK_FREE_PATTERN, self.html) + self.link = re.search(self.LINK_FREE_PATTERN, self.html) -- cgit v1.2.3 From cf4ded052964047de88d676045329b8fa4fca2dc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 22 Jan 2015 21:31:19 +0100 Subject: Update plugins after CaptchaService changes --- module/plugins/hoster/NitroflareCom.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/NitroflareCom.py') diff --git a/module/plugins/hoster/NitroflareCom.py b/module/plugins/hoster/NitroflareCom.py index 722fb6eaf..e21d067b3 100644 --- a/module/plugins/hoster/NitroflareCom.py +++ b/module/plugins/hoster/NitroflareCom.py @@ -16,7 +16,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster class NitroflareCom(SimpleHoster): __name__ = "NitroflareCom" __type__ = "hoster" - __version__ = "0.06" + __version__ = "0.07" __pattern__ = r'https?://(?:www\.)?nitroflare\.com/view/(?P[\w^_]+)' @@ -32,6 +32,8 @@ class NitroflareCom(SimpleHoster): LINK_FREE_PATTERN = r'(https?://[\w\-]+\.nitroflare\.com/.+?)"' + RECAPTCHA_KEY = "6Lenx_USAAAAAF5L1pmTWvWcH73dipAEzNnmNLgy" + PREMIUM_ONLY_PATTERN = r'This file is available with Premium only' WAIT_PATTERN = r'You have to wait .+?<' ERROR_PATTERN = r'downloading is not possible' @@ -81,7 +83,7 @@ class NitroflareCom(SimpleHoster): self.wait(wait_time) recaptcha = ReCaptcha(self) - challenge, response = recaptcha.challenge("6Lenx_USAAAAAF5L1pmTWvWcH73dipAEzNnmNLgy") + response, challenge = recaptcha.challenge(self.RECAPTCHA_KEY) self.html = self.load("http://nitroflare.com/ajax/freeDownload.php", post={'method' : "fetchDownload", -- cgit v1.2.3 From 79725268402043906f619f7c09e848e02ab8a17b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 31 Jan 2015 22:00:59 +0100 Subject: Spare code cosmetics --- module/plugins/hoster/NitroflareCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/NitroflareCom.py') diff --git a/module/plugins/hoster/NitroflareCom.py b/module/plugins/hoster/NitroflareCom.py index e21d067b3..434d130ce 100644 --- a/module/plugins/hoster/NitroflareCom.py +++ b/module/plugins/hoster/NitroflareCom.py @@ -49,8 +49,8 @@ class NitroflareCom(SimpleHoster): elif hasattr(self, 'WAIT_PATTERN'): m = re.search(self.WAIT_PATTERN, self.html) if m: - wait_time = sum([int(v) * {"hr": 3600, "hour": 3600, "min": 60, "sec": 1}[u.lower()] for v, u in - re.findall(r'(\d+)\s*(hr|hour|min|sec)', m.group(0), re.I)]) + wait_time = sum(int(v) * {"hr": 3600, "hour": 3600, "min": 60, "sec": 1}[u.lower()] for v, u in + re.findall(r'(\d+)\s*(hr|hour|min|sec)', m.group(0), re.I)) self.wait(wait_time, wait_time > 300) return -- cgit v1.2.3 From 82509d01b3464da485f9e02f5afeda0b5b0adbd4 Mon Sep 17 00:00:00 2001 From: stickell Date: Sat, 14 Feb 2015 20:28:05 +0100 Subject: [NitroflareCom] Fixed #1176 --- module/plugins/hoster/NitroflareCom.py | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'module/plugins/hoster/NitroflareCom.py') diff --git a/module/plugins/hoster/NitroflareCom.py b/module/plugins/hoster/NitroflareCom.py index 434d130ce..5bbef64de 100644 --- a/module/plugins/hoster/NitroflareCom.py +++ b/module/plugins/hoster/NitroflareCom.py @@ -16,14 +16,15 @@ from module.plugins.internal.SimpleHoster import SimpleHoster class NitroflareCom(SimpleHoster): __name__ = "NitroflareCom" __type__ = "hoster" - __version__ = "0.07" + __version__ = "0.08" __pattern__ = r'https?://(?:www\.)?nitroflare\.com/view/(?P[\w^_]+)' __description__ = """Nitroflare.com hoster plugin""" __license__ = "GPLv3" __authors__ = [("sahil", "sahilshekhawat01@gmail.com"), - ("Walter Purcaro", "vuolter@gmail.com")] + ("Walter Purcaro", "vuolter@gmail.com"), + ("Stickell", "l.stickell@yahoo.it")] # URL_REPLACEMENTS = [("http://", "https://")] @@ -35,7 +36,7 @@ class NitroflareCom(SimpleHoster): RECAPTCHA_KEY = "6Lenx_USAAAAAF5L1pmTWvWcH73dipAEzNnmNLgy" PREMIUM_ONLY_PATTERN = r'This file is available with Premium only' - WAIT_PATTERN = r'You have to wait .+?<' + WAIT_PATTERN = r'You have to wait .+' ERROR_PATTERN = r'downloading is not possible' @@ -67,8 +68,9 @@ class NitroflareCom(SimpleHoster): # used here to load the cookies which will be required later self.load(pyfile.url, post={'goToFreePage': ""}) - self.html = self.load("http://nitroflare.com/ajax/freeDownload.php", - post={'method': "startTimer", 'fileId': self.info['pattern']['ID']})[4:] + self.load("https://www.nitroflare.com/ajax/setCookie.php", post={'fileId': self.info['pattern']['ID']}) + self.html = self.load("https://www.nitroflare.com/ajax/freeDownload.php", + post={'method': "startTimer", 'fileId': self.info['pattern']['ID']}) self.checkErrors() @@ -85,17 +87,21 @@ class NitroflareCom(SimpleHoster): recaptcha = ReCaptcha(self) response, challenge = recaptcha.challenge(self.RECAPTCHA_KEY) - self.html = self.load("http://nitroflare.com/ajax/freeDownload.php", + self.html = self.load("https://www.nitroflare.com/ajax/freeDownload.php", post={'method' : "fetchDownload", 'recaptcha_challenge_field': challenge, - 'recaptcha_response_field' : response})[3:] - - self.logDebug(self.html) + 'recaptcha_response_field' : response}) if "The captcha wasn't entered correctly" in self.html: + self.logWarning("The captcha wasn't entered correctly") return if "You have to fill the captcha" in self.html: + self.logWarning("Captcha unfilled") return - self.link = re.search(self.LINK_FREE_PATTERN, self.html) + m = re.search(self.LINK_FREE_PATTERN, self.html) + if m: + self.link = m.group(1) + else: + self.logError("Unable to detect direct link") -- cgit v1.2.3 From e97a288e2b33ed1774525c795851c9e82c712180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20H=C3=B6rnlein?= Date: Tue, 17 Mar 2015 23:09:14 +0100 Subject: [NitroflareCom] Switch back to http --- module/plugins/hoster/NitroflareCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/NitroflareCom.py') diff --git a/module/plugins/hoster/NitroflareCom.py b/module/plugins/hoster/NitroflareCom.py index 5bbef64de..6196e0862 100644 --- a/module/plugins/hoster/NitroflareCom.py +++ b/module/plugins/hoster/NitroflareCom.py @@ -16,7 +16,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster class NitroflareCom(SimpleHoster): __name__ = "NitroflareCom" __type__ = "hoster" - __version__ = "0.08" + __version__ = "0.09" __pattern__ = r'https?://(?:www\.)?nitroflare\.com/view/(?P[\w^_]+)' @@ -68,8 +68,8 @@ class NitroflareCom(SimpleHoster): # used here to load the cookies which will be required later self.load(pyfile.url, post={'goToFreePage': ""}) - self.load("https://www.nitroflare.com/ajax/setCookie.php", post={'fileId': self.info['pattern']['ID']}) - self.html = self.load("https://www.nitroflare.com/ajax/freeDownload.php", + self.load("http://nitroflare.com/ajax/setCookie.php", post={'fileId': self.info['pattern']['ID']}) + self.html = self.load("http://nitroflare.com/ajax/freeDownload.php", post={'method': "startTimer", 'fileId': self.info['pattern']['ID']}) self.checkErrors() @@ -87,7 +87,7 @@ class NitroflareCom(SimpleHoster): recaptcha = ReCaptcha(self) response, challenge = recaptcha.challenge(self.RECAPTCHA_KEY) - self.html = self.load("https://www.nitroflare.com/ajax/freeDownload.php", + self.html = self.load("http://nitroflare.com/ajax/freeDownload.php", post={'method' : "fetchDownload", 'recaptcha_challenge_field': challenge, 'recaptcha_response_field' : response}) -- cgit v1.2.3 From 2bc144adb6bc2759b635e09687b27bf96074827f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 18 Mar 2015 13:39:07 +0100 Subject: Spare code cosmetics --- module/plugins/hoster/NitroflareCom.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'module/plugins/hoster/NitroflareCom.py') diff --git a/module/plugins/hoster/NitroflareCom.py b/module/plugins/hoster/NitroflareCom.py index 6196e0862..cffa0e9a5 100644 --- a/module/plugins/hoster/NitroflareCom.py +++ b/module/plugins/hoster/NitroflareCom.py @@ -1,14 +1,7 @@ # -*- coding: utf-8 -*- -# -# Note: -# Right now premium support is not added -# Thus, any file that require premium support -# cannot be downloaded. Only the file that is free to -# download can be downloaded. import re -from module.common.json_layer import json_loads from module.plugins.internal.CaptchaService import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster @@ -36,7 +29,7 @@ class NitroflareCom(SimpleHoster): RECAPTCHA_KEY = "6Lenx_USAAAAAF5L1pmTWvWcH73dipAEzNnmNLgy" PREMIUM_ONLY_PATTERN = r'This file is available with Premium only' - WAIT_PATTERN = r'You have to wait .+' + WAIT_PATTERN = r'You have to wait .+?<' ERROR_PATTERN = r'downloading is not possible' -- cgit v1.2.3 From 7d90803262ccbb4fc5296a4dc3ce30fe98f55631 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 25 Mar 2015 23:10:07 +0100 Subject: __config__ cosmetics --- module/plugins/hoster/NitroflareCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/NitroflareCom.py') diff --git a/module/plugins/hoster/NitroflareCom.py b/module/plugins/hoster/NitroflareCom.py index cffa0e9a5..40bf0749f 100644 --- a/module/plugins/hoster/NitroflareCom.py +++ b/module/plugins/hoster/NitroflareCom.py @@ -12,6 +12,7 @@ class NitroflareCom(SimpleHoster): __version__ = "0.09" __pattern__ = r'https?://(?:www\.)?nitroflare\.com/view/(?P[\w^_]+)' + __config__ = [("use_premium", "bool", "Use premium account if available", True)] __description__ = """Nitroflare.com hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 14600aa22812176c4f61ffcfd4ae3b0ee62ae368 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 18 May 2015 05:25:09 +0200 Subject: Spare plugins updates --- module/plugins/hoster/NitroflareCom.py | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) (limited to 'module/plugins/hoster/NitroflareCom.py') diff --git a/module/plugins/hoster/NitroflareCom.py b/module/plugins/hoster/NitroflareCom.py index 40bf0749f..e10bf130b 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.09" + __version__ = "0.10" __pattern__ = r'https?://(?:www\.)?nitroflare\.com/view/(?P[\w^_]+)' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -34,30 +34,6 @@ class NitroflareCom(SimpleHoster): ERROR_PATTERN = r'downloading is not possible' - def checkErrors(self): - if not self.html: - return - - if not self.premium and re.search(self.PREMIUM_ONLY_PATTERN, self.html): - self.fail(_("Link require a premium account to be handled")) - - elif hasattr(self, 'WAIT_PATTERN'): - m = re.search(self.WAIT_PATTERN, self.html) - if m: - wait_time = sum(int(v) * {"hr": 3600, "hour": 3600, "min": 60, "sec": 1}[u.lower()] for v, u in - re.findall(r'(\d+)\s*(hr|hour|min|sec)', m.group(0), re.I)) - self.wait(wait_time, wait_time > 300) - return - - elif hasattr(self, 'ERROR_PATTERN'): - m = re.search(self.ERROR_PATTERN, self.html) - if m: - errmsg = self.info['error'] = m.group(1) - self.error(errmsg) - - self.info.pop('error', None) - - def handleFree(self, pyfile): # used here to load the cookies which will be required later self.load(pyfile.url, post={'goToFreePage': ""}) -- cgit v1.2.3 From 9bb3bff1a97c11ee887446d24015d0def499e18c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 22 May 2015 22:49:11 +0200 Subject: [SimpleHoster] Fix captcha retrying --- module/plugins/hoster/NitroflareCom.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'module/plugins/hoster/NitroflareCom.py') diff --git a/module/plugins/hoster/NitroflareCom.py b/module/plugins/hoster/NitroflareCom.py index e10bf130b..1d1349a50 100644 --- a/module/plugins/hoster/NitroflareCom.py +++ b/module/plugins/hoster/NitroflareCom.py @@ -27,8 +27,6 @@ class NitroflareCom(SimpleHoster): LINK_FREE_PATTERN = r'(https?://[\w\-]+\.nitroflare\.com/.+?)"' - RECAPTCHA_KEY = "6Lenx_USAAAAAF5L1pmTWvWcH73dipAEzNnmNLgy" - PREMIUM_ONLY_PATTERN = r'This file is available with Premium only' WAIT_PATTERN = r'You have to wait .+?<' ERROR_PATTERN = r'downloading is not possible' @@ -70,8 +68,4 @@ class NitroflareCom(SimpleHoster): self.logWarning("Captcha unfilled") return - m = re.search(self.LINK_FREE_PATTERN, self.html) - if m: - self.link = m.group(1) - else: - self.logError("Unable to detect direct link") + return super(NitroflareCom, self).handleFree(pyfile) -- cgit v1.2.3 From 02a4218250dbad6ba004382c090a9a6dc241bcda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20H=C3=B6rnlein?= Date: Mon, 25 May 2015 18:29:33 +0200 Subject: [NitroFlare] Re-Added RECAPTCHA_KEY --- module/plugins/hoster/NitroflareCom.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster/NitroflareCom.py') diff --git a/module/plugins/hoster/NitroflareCom.py b/module/plugins/hoster/NitroflareCom.py index 1d1349a50..b00f8f52a 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.10" + __version__ = "0.11" __pattern__ = r'https?://(?:www\.)?nitroflare\.com/view/(?P[\w^_]+)' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -27,6 +27,7 @@ class NitroflareCom(SimpleHoster): LINK_FREE_PATTERN = r'(https?://[\w\-]+\.nitroflare\.com/.+?)"' + RECAPTCHA_KEY = "6Lenx_USAAAAAF5L1pmTWvWcH73dipAEzNnmNLgy" PREMIUM_ONLY_PATTERN = r'This file is available with Premium only' WAIT_PATTERN = r'You have to wait .+?<' ERROR_PATTERN = r'downloading is not possible' -- cgit v1.2.3 From 1e8dd61f1d9f7cef947216887f898bb6b86ee34a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20H=C3=B6rnlein?= Date: Mon, 25 May 2015 19:55:59 +0200 Subject: [NitroflareCom] Update Pattern --- module/plugins/hoster/NitroflareCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/NitroflareCom.py') diff --git a/module/plugins/hoster/NitroflareCom.py b/module/plugins/hoster/NitroflareCom.py index b00f8f52a..6696d15d3 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.11" + __version__ = "0.12" __pattern__ = r'https?://(?:www\.)?nitroflare\.com/view/(?P[\w^_]+)' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -29,8 +29,8 @@ class NitroflareCom(SimpleHoster): RECAPTCHA_KEY = "6Lenx_USAAAAAF5L1pmTWvWcH73dipAEzNnmNLgy" PREMIUM_ONLY_PATTERN = r'This file is available with Premium only' - WAIT_PATTERN = r'You have to wait .+?<' - ERROR_PATTERN = r'downloading is not possible' + WAIT_PATTERN = r'You have to wait (\d+ minutes)' + # ERROR_PATTERN = r'downloading is not possible' def handleFree(self, pyfile): -- cgit v1.2.3