diff options
30 files changed, 123 insertions, 109 deletions
diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py index 3c84ce5da..d7143952b 100644 --- a/module/plugins/hoster/BitshareCom.py +++ b/module/plugins/hoster/BitshareCom.py @@ -23,7 +23,6 @@ class BitshareCom(SimpleHoster): OFFLINE_PATTERN = r'(>We are sorry, but the requested file was not found in our database|>Error - File not available<|The file was deleted either by the uploader, inactivity or due to copyright claim)' FILE_AJAXID_PATTERN = r'var ajaxdl = "(.*?)";' - CAPTCHA_KEY_PATTERN = r'http://api\.recaptcha\.net/challenge\?k=(.*?) ' TRAFFIC_USED_UP = r'Your Traffic is used up for today. Upgrade to premium to continue!' @@ -108,12 +107,15 @@ class BitshareCom(SimpleHoster): # Resolve captcha if captcha == 1: self.logDebug("File is captcha protected") - id = re.search(self.CAPTCHA_KEY_PATTERN, self.html).group(1) + recaptcha = ReCaptcha(self) + captcha_key = recaptcha.detect_key() + if captcha_key is None: + self.parseError("ReCaptcha captcha key not found") + # Try up to 3 times for i in xrange(3): - self.logDebug("Resolving ReCaptcha with key [%s], round %d" % (id, i + 1)) - recaptcha = ReCaptcha(self) - challenge, code = recaptcha.challenge(id) + self.logDebug("Resolving ReCaptcha with key [%s], round %d" % (captcha_key, i + 1)) + challenge, code = recaptcha.challenge(captcha_key) response = self.load("http://bitshare.com/files-ajax/" + self.file_id + "/request.html", post={"request": "validateCaptcha", "ajaxid": self.ajaxid, "recaptcha_challenge_field": challenge, "recaptcha_response_field": code}) diff --git a/module/plugins/hoster/CatShareNet.py b/module/plugins/hoster/CatShareNet.py index 121973e4d..6bfbe0f1a 100644 --- a/module/plugins/hoster/CatShareNet.py +++ b/module/plugins/hoster/CatShareNet.py @@ -25,7 +25,6 @@ class CatShareNet(SimpleHoster): IP_BLOCKED_PATTERN = r'>Nasz serwis wykrył że Twój adres IP nie pochodzi z Polski.<' SECONDS_PATTERN = 'var\scount\s=\s(\d+);' - RECAPTCHA_KEY = "6Lfln9kSAAAAANZ9JtHSOgxUPB9qfDFeLUI_QMEy" LINK_PATTERN = r'<form action="(.+?)" method="GET">' @@ -48,7 +47,12 @@ class CatShareNet(SimpleHoster): self.wait(wait_time, True) recaptcha = ReCaptcha(self) - challenge, code = recaptcha.challenge(self.RECAPTCHA_KEY) + + captcha_key = recaptcha.detect_key() + if captcha_key is None: + self.parseError("ReCaptcha key not found") + + challenge, code = recaptcha.challenge(captcha_key) self.html = self.load(self.pyfile.url, post={'recaptcha_challenge_field': challenge, 'recaptcha_response_field': code}) diff --git a/module/plugins/hoster/CrockoCom.py b/module/plugins/hoster/CrockoCom.py index 80d9b3d61..8888802a9 100644 --- a/module/plugins/hoster/CrockoCom.py +++ b/module/plugins/hoster/CrockoCom.py @@ -22,7 +22,6 @@ class CrockoCom(SimpleHoster): OFFLINE_PATTERN = r"<h1>Sorry,<br />the page you're looking for <br />isn't here.</h1>|File not found" CAPTCHA_URL_PATTERN = re.compile(r"u='(/file_contents/captcha/\w+)';\s*w='(\d+)';") - CAPTCHA_KEY_PATTERN = re.compile(r'Recaptcha.create\("([^"]+)"') FORM_PATTERN = r'<form method="post" action="([^"]+)">(.*?)</form>' FORM_INPUT_PATTERN = r'<input[^>]* name="?([^" ]+)"? value="?([^" ]+)"?[^>]*>' @@ -43,10 +42,10 @@ class CrockoCom(SimpleHoster): else: break - m = re.search(self.CAPTCHA_KEY_PATTERN, self.html) - if m is None: - self.parseError('Captcha KEY') - captcha_key = m.group(1) + recaptcha = ReCaptcha(self) + captcha_key = recaptcha.detect_key() + if captcha_key is None: + self.parseError("ReCaptcha captcha key not found") m = re.search(self.FORM_PATTERN, self.html, re.DOTALL) if m is None: @@ -54,14 +53,12 @@ class CrockoCom(SimpleHoster): action, form = m.groups() inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form)) - recaptcha = ReCaptcha(self) - for _ in xrange(5): inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge(captcha_key) self.download(action, post=inputs) check = self.checkDownload({ - "captcha_err": self.CAPTCHA_KEY_PATTERN + "captcha_err": recaptcha.KEY_AJAX_PATTERN }) if check == "captcha_err": diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index c5155dc31..b57cdebc7 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -24,7 +24,6 @@ class DateiTo(SimpleHoster): WAIT_PATTERN = r'countdown\({seconds: (\d+)' DATA_PATTERN = r'url: "(.*?)", data: "(.*?)",' - RECAPTCHA_KEY_PATTERN = r'Recaptcha.create\("(.*?)"' def handleFree(self): @@ -52,10 +51,11 @@ class DateiTo(SimpleHoster): data = dict(x.split('=') for x in m.group(2).split('&')) if url.endswith('recaptcha.php'): - m = re.search(self.RECAPTCHA_KEY_PATTERN, self.html) - recaptcha_key = m.group(1) if m else "6LdBbL8SAAAAAI0vKUo58XRwDd5Tu_Ze1DA7qTao" + captcha_key = recaptcha.detect_key() + if captcha_key is None: + self.parseError("ReCaptcha key not found") - data['recaptcha_challenge_field'], data['recaptcha_response_field'] = recaptcha.challenge(recaptcha_key) + data['recaptcha_challenge_field'], data['recaptcha_response_field'] = recaptcha.challenge(captcha_key) else: self.fail('Too bad...') diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py index 9ff8c22a1..459096f96 100644 --- a/module/plugins/hoster/DepositfilesCom.py +++ b/module/plugins/hoster/DepositfilesCom.py @@ -29,8 +29,6 @@ class DepositfilesCom(SimpleHoster): COOKIES = [(".dfiles.eu", "lang_current", "en")] - RECAPTCHA_PATTERN = r"Recaptcha.create\('([^']+)'" - FREE_LINK_PATTERN = r'<form id="downloader_file_form" action="(http://.+?\.(dfiles\.eu|depositfiles\.com)/.+?)" method="post"' PREMIUM_LINK_PATTERN = r'class="repeat"><a href="(.+?)"' PREMIUM_MIRROR_PATTERN = r'class="repeat_mirror"><a href="(.+?)"' @@ -67,21 +65,16 @@ class DepositfilesCom(SimpleHoster): params = {'fid': m.group(1)} self.logDebug("FID: %s" % params['fid']) - captcha_key = '6LdRTL8SAAAAAE9UOdWZ4d0Ky-aeA7XfSqyWDM2m' - m = re.search(self.RECAPTCHA_PATTERN, self.html) - if m: - captcha_key = m.group(1) - self.logDebug("CAPTCHA_KEY: %s" % captcha_key) - self.wait() recaptcha = ReCaptcha(self) + captcha_key = recaptcha.detect_key() + if captcha_key is None: + self.parseError("ReCaptcha key not found") for _ in xrange(5): self.html = self.load("https://dfiles.eu/get_file.php", get=params) if '<input type=button value="Continue" onclick="check_recaptcha' in self.html: - if not captcha_key: - self.parseError('Captcha key') if 'response' in params: self.invalidCaptcha() params['challenge'], params['response'] = recaptcha.challenge(captcha_key) diff --git a/module/plugins/hoster/EasybytezCom.py b/module/plugins/hoster/EasybytezCom.py index ed9230263..028bf198c 100644 --- a/module/plugins/hoster/EasybytezCom.py +++ b/module/plugins/hoster/EasybytezCom.py @@ -18,7 +18,7 @@ class EasybytezCom(XFileSharingPro): HOSTER_NAME = "easybytez.com" FILE_INFO_PATTERN = r'<span class="name">(?P<N>.+)</span><br>\s*<span class="size">(?P<S>[^<]+)</span>' - OFFLINE_PATTERN = r'<h1>File not available</h1>' + OFFLINE_PATTERN = r'>File not available' LINK_PATTERN = r'(http://(\w+\.(easyload|easybytez|zingload)\.(com|to)|\d+\.\d+\.\d+\.\d+)/files/\d+/\w+/[^"<]+)' OVR_LINK_PATTERN = r'<h2>Download Link</h2>\s*<textarea[^>]*>([^<]+)' diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index a99e43731..49667a722 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -24,7 +24,6 @@ class EgoFilesCom(SimpleHoster): OFFLINE_PATTERN = r'(File size|Rozmiar): 0 KB' WAIT_TIME_PATTERN = r'For next free download you have to wait <strong>((?P<m>\d*)m)? ?((?P<s>\d+)s)?</strong>' LINK_PATTERN = r'<a href="(?P<link>[^"]+)">Download ></a>' - RECAPTCHA_KEY = "6LeXatQSAAAAAHezcjXyWAni-4t302TeYe7_gfvX" def setup(self): @@ -48,9 +47,15 @@ class EgoFilesCom(SimpleHoster): self.wait(waittime, True) downloadURL = r'' + recaptcha = ReCaptcha(self) + + captcha_key = recaptcha.detect_key() + if captcha_key is None: + self.parseError("ReCaptcha key not found") + for _ in xrange(5): - challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) + challenge, response = recaptcha.challenge(captcha_key) post_data = {'recaptcha_challenge_field': challenge, 'recaptcha_response_field': response} self.html = self.load(self.pyfile.url, post=post_data, decode=True) diff --git a/module/plugins/hoster/EpicShareNet.py b/module/plugins/hoster/EpicShareNet.py index 73b16c08e..81e28f8aa 100644 --- a/module/plugins/hoster/EpicShareNet.py +++ b/module/plugins/hoster/EpicShareNet.py @@ -19,7 +19,6 @@ class EpicShareNet(XFileSharingPro): HOSTER_NAME = "epicshare.net" - OFFLINE_PATTERN = r'<b>File Not Found</b><br><br>' FILE_NAME_PATTERN = r'<b>Password:</b></div>\s*<h2>(?P<N>[^<]+)</h2>' diff --git a/module/plugins/hoster/FilecloudIo.py b/module/plugins/hoster/FilecloudIo.py index 025bd483f..c90e7d6d8 100644 --- a/module/plugins/hoster/FilecloudIo.py +++ b/module/plugins/hoster/FilecloudIo.py @@ -26,9 +26,9 @@ class FilecloudIo(SimpleHoster): UKEY_PATTERN = r"'ukey'\s*:'(\w+)'," AB1_PATTERN = r"if\( __ab1 == '(\w+)' \)" ERROR_MSG_PATTERN = r'var __error_msg\s*=\s*l10n\.(.*?);' + RECAPTCHA_PATTERN = r"var __recaptcha_public\s*=\s*'([^']+)';" + LINK_PATTERN = r'"(http://s\d+.filecloud.io/%s/\d+/.*?)"' - RECAPTCHA_KEY_PATTERN = r"var __recaptcha_public\s*=\s*'([^']+)';" - RECAPTCHA_KEY = "6Lf5OdISAAAAAEZObLcx5Wlv4daMaASRov1ysDB1" def setup(self): @@ -43,11 +43,18 @@ class FilecloudIo(SimpleHoster): self.parseError("__AB1") data['__ab1'] = m.group(1) + recaptcha = ReCaptcha(self) + + m = re.search(self.RECAPTCHA_PATTERN, self.html) + captcha_key = m.group(1) if m else recaptcha.detect_key() + + if captcha_key is None: + self.parseError("ReCaptcha key not found") + if not self.account: self.fail("User not logged in") elif not self.account.logged_in: - recaptcha = ReCaptcha(self) - captcha_challenge, captcha_response = recaptcha.challenge(self.RECAPTCHA_KEY) + captcha_challenge, captcha_response = recaptcha.challenge(captcha_key) self.account.form_data = {"recaptcha_challenge_field": captcha_challenge, "recaptcha_response_field": captcha_response} self.account.relogin(self.user) @@ -63,9 +70,6 @@ class FilecloudIo(SimpleHoster): self.logDebug(response) if response['captcha']: - recaptcha = ReCaptcha(self) - m = re.search(self.RECAPTCHA_KEY_PATTERN, self.html) - captcha_key = m.group(1) if m else self.RECAPTCHA_KEY data['ctype'] = "recaptcha" for _ in xrange(5): diff --git a/module/plugins/hoster/FilepostCom.py b/module/plugins/hoster/FilepostCom.py index c5439cf01..c96f20c06 100644 --- a/module/plugins/hoster/FilepostCom.py +++ b/module/plugins/hoster/FilepostCom.py @@ -24,7 +24,7 @@ class FilepostCom(SimpleHoster): OFFLINE_PATTERN = r'class="error_msg_title"> Invalid or Deleted File. </div>|<div class="file_info file_info_deleted">' PREMIUM_ONLY_PATTERN = r'members only. Please upgrade to premium|a premium membership is required to download this file' - RECAPTCHA_KEY_PATTERN = r"Captcha.init\({\s*key:\s*'([^']+)'" + RECAPTCHA_PATTERN = r"Captcha.init\({\s*key:\s*'([^']+)'" FLP_TOKEN_PATTERN = r"set_store_options\({token: '([^']+)'" @@ -37,7 +37,7 @@ class FilepostCom(SimpleHoster): self.parseError("Token") flp_token = m.group(1) - m = re.search(self.RECAPTCHA_KEY_PATTERN, self.html) + m = re.search(self.RECAPTCHA_PATTERN, self.html) if m is None: self.parseError("Captcha key") captcha_key = m.group(1) diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index 3ad9f2091..3082c790b 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -26,7 +26,6 @@ class FilerNet(SimpleHoster): FILE_INFO_PATTERN = r'<h1 class="page-header">Free Download (?P<N>\S+) <small>(?P<S>[\w.]+) (?P<U>\w+)</small></h1>' OFFLINE_PATTERN = r'Nicht gefunden' - RECAPTCHA_KEY = "6LcFctISAAAAAAgaeHgyqhNecGJJRnxV1m_vAz3V" LINK_PATTERN = r'href="([^"]+)">Get download</a>' @@ -65,9 +64,15 @@ class FilerNet(SimpleHoster): self.logDebug("Hash: " + hash_data) downloadURL = r'' + recaptcha = ReCaptcha(self) + + captcha_key = recaptcha.detect_key() + if captcha_key is None: + self.parseError("ReCaptcha key not found") + for _ in xrange(5): - challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) + challenge, response = recaptcha.challenge(captcha_key) post_data = {'recaptcha_challenge_field': challenge, 'recaptcha_response_field': response, 'hash': hash_data} diff --git a/module/plugins/hoster/FilerioCom.py b/module/plugins/hoster/FilerioCom.py index a62f77f25..d64796531 100644 --- a/module/plugins/hoster/FilerioCom.py +++ b/module/plugins/hoster/FilerioCom.py @@ -17,7 +17,7 @@ class FilerioCom(XFileSharingPro): HOSTER_NAME = "filerio.in" - OFFLINE_PATTERN = r'<b>"File Not Found"</b>|File has been removed due to Copyright Claim' + OFFLINE_PATTERN = r'>"File Not Found|File has been removed' FILE_URL_REPLACEMENTS = [(r'http://.*?/', 'http://filerio.in/')] diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py index 5dfd14d82..0cdb00b30 100644 --- a/module/plugins/hoster/IfileIt.py +++ b/module/plugins/hoster/IfileIt.py @@ -19,7 +19,7 @@ class IfileIt(SimpleHoster): __author_mail__ = "zoidberg@mujmail.cz" LINK_PATTERN = r'</span> If it doesn\'t, <a target="_blank" href="([^"]+)">' - RECAPTCHA_KEY_PATTERN = r"var __recaptcha_public\s*=\s*'([^']+)';" + RECAPTCHA_PATTERN = r"var __recaptcha_public\s*=\s*'([^']+)';" FILE_INFO_PATTERN = r'<span style="cursor: default;[^>]*>\s*(?P<N>.*?)\s* \s*<strong>\s*(?P<S>[0-9.]+)\s*(?P<U>[kKMG])i?B\s*</strong>\s*</span>' OFFLINE_PATTERN = r'<span style="cursor: default;[^>]*>\s* \s*<strong>\s*</strong>\s*</span>' TEMP_OFFLINE_PATTERN = r'<span class="msg_red">Downloading of this file is temporarily disabled</span>' @@ -36,7 +36,8 @@ class IfileIt(SimpleHoster): self.offline() if json_response['captcha']: - captcha_key = re.search(self.RECAPTCHA_KEY_PATTERN, self.html).group(1) + captcha_key = re.search(self.RECAPTCHA_PATTERN, self.html).group(1) + recaptcha = ReCaptcha(self) post_data['ctype'] = "recaptcha" diff --git a/module/plugins/hoster/Keep2shareCC.py b/module/plugins/hoster/Keep2shareCC.py index f17faae46..bf2150a48 100644 --- a/module/plugins/hoster/Keep2shareCC.py +++ b/module/plugins/hoster/Keep2shareCC.py @@ -28,8 +28,6 @@ class Keep2shareCC(SimpleHoster): WAIT_PATTERN = r'Please wait ([\d:]+) to download this file' MULTIDL_ERROR = r'Free account does not allow to download more than one file at the same time' - RECAPTCHA_KEY = "6LcYcN0SAAAAABtMlxKj7X0hRxOY8_2U86kI1vbb" - def handleFree(self): self.sanitize_url() @@ -72,8 +70,13 @@ class Keep2shareCC(SimpleHoster): def handleCaptcha(self): recaptcha = ReCaptcha(self) + + captcha_key = recaptcha.detect_key() + if captcha_key is None: + self.parseError("ReCaptcha key not found") + for _ in xrange(5): - challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) + challenge, response = recaptcha.challenge(captcha_key) post_data = {'recaptcha_challenge_field': challenge, 'recaptcha_response_field': response, 'CaptchaForm%5Bcode%5D': '', diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index 4d87a5933..66a639a14 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -27,7 +27,6 @@ class KingfilesNet(SimpleHoster): RAND_ID_PATTERN = r'type=\"hidden\" name=\"rand\" value=\"(.+)\">' LINK_PATTERN = r'var download_url = \'(.+)\';' - SOLVEMEDIA_PATTERN = r'http://api\.solvemedia\.com/papi/challenge\.script\?k=(.+)\">' def setup(self): @@ -50,13 +49,12 @@ class KingfilesNet(SimpleHoster): 'method_free': "+"} b = self.load(self.pyfile.url, post=post_data, cookies=True, decode=True) - # Do the captcha stuff - m = re.search(self.SOLVEMEDIA_PATTERN, b) - if m is None: - self.parseError("Captcha key not found") - solvemedia = SolveMedia(self) - captcha_key = m.group(1) + + captcha_key = solvemedia.detect_key() + if captcha_key is None: + self.parseError("SolveMedia key not found") + self.logDebug("captcha_key", captcha_key) captcha_challenge, captcha_response = solvemedia.challenge(captcha_key) diff --git a/module/plugins/hoster/LemUploadsCom.py b/module/plugins/hoster/LemUploadsCom.py index 1b0c40b96..649e7f739 100644 --- a/module/plugins/hoster/LemUploadsCom.py +++ b/module/plugins/hoster/LemUploadsCom.py @@ -20,7 +20,6 @@ class LemUploadsCom(XFileSharingPro): HOSTER_NAME = "lemuploads.com" - OFFLINE_PATTERN = r'<b>File Not Found</b><br><br>' FILE_NAME_PATTERN = r'<b>Password:</b></div>\s*<h2>(?P<N>[^<]+)</h2>' diff --git a/module/plugins/hoster/LetitbitNet.py b/module/plugins/hoster/LetitbitNet.py index ec1dd14bd..2d6130d3c 100644 --- a/module/plugins/hoster/LetitbitNet.py +++ b/module/plugins/hoster/LetitbitNet.py @@ -50,7 +50,6 @@ class LetitbitNet(SimpleHoster): SECONDS_PATTERN = r'seconds\s*=\s*(\d+);' CAPTCHA_CONTROL_FIELD = r"recaptcha_control_field\s=\s'(?P<value>[^']+)'" - RECAPTCHA_KEY = "6Lc9zdMSAAAAAF-7s2wuQ-036pLRbM0p8dDaQdAM" def setup(self): @@ -108,7 +107,13 @@ class LetitbitNet(SimpleHoster): self.logDebug(response) recaptcha = ReCaptcha(self) - challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) + + captcha_key = recaptcha.detect_key() + if captcha_key is None: + self.parseError("ReCaptcha key not found") + + challenge, response = recaptcha.challenge(captcha_key) + post_data = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": response, "recaptcha_control_field": recaptcha_control_field} self.logDebug("Post data to send", post_data) diff --git a/module/plugins/hoster/LoadTo.py b/module/plugins/hoster/LoadTo.py index 18398e905..377509050 100644 --- a/module/plugins/hoster/LoadTo.py +++ b/module/plugins/hoster/LoadTo.py @@ -27,7 +27,6 @@ class LoadTo(SimpleHoster): LINK_PATTERN = r'<form method="post" action="(.+?)"' WAIT_PATTERN = r'type="submit" value="Download \((\d+)\)"' - SOLVEMEDIA_PATTERN = r'http://api\.solvemedia\.com/papi/challenge\.noscript\?k=([^"]+)' FILE_URL_REPLACEMENTS = [(r'(\w)$', r'\1/')] @@ -51,12 +50,12 @@ class LoadTo(SimpleHoster): self.wait(m.group(1)) # Load.to is using solvemedia captchas since ~july 2014: - m = re.search(self.SOLVEMEDIA_PATTERN, self.html) - if m is None: + solvemedia = SolveMedia(self) + captcha_key = solvemedia.detect_key() + + if captcha_key is None: self.download(download_url) else: - captcha_key = m.group(1) - solvemedia = SolveMedia(self) captcha_challenge, captcha_response = solvemedia.challenge(captcha_key) self.download(download_url, post={"adcopy_challenge": captcha_challenge, "adcopy_response": captcha_response}) check = self.checkDownload({"404": re.compile("\A<h1>404 Not Found</h1>")}) diff --git a/module/plugins/hoster/LuckyShareNet.py b/module/plugins/hoster/LuckyShareNet.py index de18b8512..4780c7108 100644 --- a/module/plugins/hoster/LuckyShareNet.py +++ b/module/plugins/hoster/LuckyShareNet.py @@ -21,7 +21,6 @@ class LuckyShareNet(SimpleHoster): FILE_INFO_PATTERN = r"<h1 class='file_name'>(?P<N>\S+)</h1>\s*<span class='file_size'>Filesize: (?P<S>[\d.]+)(?P<U>\w+)</span>" OFFLINE_PATTERN = r'There is no such file available' - RECAPTCHA_KEY = "6LdivsgSAAAAANWh-d7rPE1mus4yVWuSQIJKIYNw" def parseJson(self, rep): @@ -50,8 +49,13 @@ class LuckyShareNet(SimpleHoster): self.wait(int(json['time'])) recaptcha = ReCaptcha(self) + + captcha_key = recaptcha.detect_key() + if captcha_key is None: + self.parseError("ReCaptcha key not found") + for _ in xrange(5): - challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) + challenge, response = recaptcha.challenge(captcha_key) rep = self.load(r"http://luckyshare.net/download/verify/challenge/%s/response/%s/hash/%s" % (challenge, response, json['hash']), decode=True) self.logDebug("JSON: " + rep) diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py index f83003424..f2dcc909a 100644 --- a/module/plugins/hoster/MediafireCom.py +++ b/module/plugins/hoster/MediafireCom.py @@ -58,7 +58,6 @@ class MediafireCom(SimpleHoster): LINK_PATTERN = r'<div class="download_link"[^>]*(?:z-index:(?P<zindex>\d+))?[^>]*>\s*<a href="(?P<href>http://[^"]+)"' JS_KEY_PATTERN = r"DoShow\('mfpromo1'\);[^{]*{((\w+)='';.*?)eval\(\2\);" JS_ZMODULO_PATTERN = r"\('z-index'\)\) \% (\d+)\)\);" - SOLVEMEDIA_PATTERN = r'http://api\.solvemedia\.com/papi/challenge\.noscript\?k=([^"]+)' PAGE1_ACTION_PATTERN = r'<link rel="canonical" href="([^"]+)"/>' PASSWORD_PATTERN = r'<form name="form_password"' @@ -111,15 +110,12 @@ class MediafireCom(SimpleHoster): self.download(download_url) def checkCaptcha(self): - for _ in xrange(5): - m = re.search(self.SOLVEMEDIA_PATTERN, self.html) - if m: - captcha_key = m.group(1) - solvemedia = SolveMedia(self) - captcha_challenge, captcha_response = solvemedia.challenge(captcha_key) - self.html = self.load(self.url, post={"adcopy_challenge": captcha_challenge, - "adcopy_response": captcha_response}, decode=True) - else: - break - else: - self.fail("No valid recaptcha solution received") + solvemedia = SolveMedia(self) + + captcha_key = solvemedia.detect_key() + if captcha_key is None: + self.parseError("SolveMedia key not found") + + captcha_challenge, captcha_response = solvemedia.challenge(captcha_key) + self.html = self.load(self.url, post={"adcopy_challenge": captcha_challenge, + "adcopy_response": captcha_response}, decode=True) diff --git a/module/plugins/hoster/MegaFilesSe.py b/module/plugins/hoster/MegaFilesSe.py index 975708597..a26d8fff3 100644 --- a/module/plugins/hoster/MegaFilesSe.py +++ b/module/plugins/hoster/MegaFilesSe.py @@ -16,7 +16,7 @@ class MegaFilesSe(XFileSharingPro): HOSTER_NAME = "megafiles.se" - OFFLINE_PATTERN = r'<b><font[^>]*>File Not Found</font></b><br><br>' + OFFLINE_PATTERN = r'><font[^>]*>File Not Found' FILE_NAME_PATTERN = r'<div[^>]+>\s*<b>(?P<N>[^<]+)</b>\s*</div>' diff --git a/module/plugins/hoster/OboomCom.py b/module/plugins/hoster/OboomCom.py index f30c64184..637735fd9 100644 --- a/module/plugins/hoster/OboomCom.py +++ b/module/plugins/hoster/OboomCom.py @@ -21,8 +21,6 @@ class OboomCom(Hoster): __author_name__ = "stanley" __author_mail__ = "stanley.foerster@gmail.com" - RECAPTCHA_KEY = "6LdqpO0SAAAAAJGHXo63HyalP7H4qlRs_vff0kJX" - def loadUrl(self, url, get=None): if get is None: @@ -49,8 +47,13 @@ class OboomCom(Hoster): def solveCaptcha(self): recaptcha = ReCaptcha(self) + + captcha_key = recaptcha.detect_key() + if captcha_key is None: + self.parseError("ReCaptcha key not found") + for _ in xrange(5): - challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) + challenge, response = recaptcha.challenge(captcha_key) apiUrl = "https://www.oboom.com/1.0/download/ticket" params = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": response, diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py index 3fea849ff..6265e13ef 100644 --- a/module/plugins/hoster/RapidgatorNet.py +++ b/module/plugins/hoster/RapidgatorNet.py @@ -34,8 +34,8 @@ class RapidgatorNet(SimpleHoster): WAIT_PATTERN = r'(?:Delay between downloads must be not less than|Try again in)\s*(\d+)\s*(hour|min)' LINK_PATTERN = r"return '(http://\w+.rapidgator.net/.*)';" - RECAPTCHA_KEY_PATTERN = r'"http://api\.recaptcha\.net/challenge\?k=(.*?)"' - ADSCAPTCHA_SRC_PATTERN = r'(http://api\.adscaptcha\.com/Get\.aspx[^"\']*)' + RECAPTCHA_PATTERN = r'"http://api\.recaptcha\.net/challenge\?k=(.*?)"' + ADSCAPTCHA_PATTERN = r'(http://api\.adscaptcha\.com/Get\.aspx[^"\']*)' SOLVEMEDIA_PATTERN = r'http://api\.solvemedia\.com/papi/challenge\.script\?k=(.*?)"' @@ -138,12 +138,12 @@ class RapidgatorNet(SimpleHoster): self.parseError("Download link") def getCaptcha(self): - m = re.search(self.ADSCAPTCHA_SRC_PATTERN, self.html) + m = re.search(self.ADSCAPTCHA_PATTERN, self.html) if m: captcha_key = m.group(1) captcha = AdsCaptcha(self) else: - m = re.search(self.RECAPTCHA_KEY_PATTERN, self.html) + m = re.search(self.RECAPTCHA_PATTERN, self.html) if m: captcha_key = m.group(1) captcha = ReCaptcha(self) diff --git a/module/plugins/hoster/RyushareCom.py b/module/plugins/hoster/RyushareCom.py index a24090cde..49fb2b07f 100644 --- a/module/plugins/hoster/RyushareCom.py +++ b/module/plugins/hoster/RyushareCom.py @@ -26,7 +26,6 @@ class RyushareCom(XFileSharingPro): WAIT_PATTERN = r'You have to wait ((?P<hour>\d+) hour[s]?, )?((?P<min>\d+) minute[s], )?(?P<sec>\d+) second[s]' LINK_PATTERN = r'<a href="([^"]+)">Click here to download<' - SOLVEMEDIA_PATTERN = r'http:\/\/api\.solvemedia\.com\/papi\/challenge\.script\?k=(.*?)"' def getDownloadLink(self): @@ -57,13 +56,13 @@ class RyushareCom(XFileSharingPro): self.retry() for _ in xrange(5): - m = re.search(self.SOLVEMEDIA_PATTERN, self.html) - if m is None: - self.parseError("Error parsing captcha") - - captchaKey = m.group(1) captcha = SolveMedia(self) - challenge, response = captcha.challenge(captchaKey) + + captcha_key = captcha.detect_key() + if captcha_key is None: + self.parseError("SolveMedia key not found") + + challenge, response = captcha.challenge(captcha_key) inputs['adcopy_challenge'] = challenge inputs['adcopy_response'] = response diff --git a/module/plugins/hoster/SecureUploadEu.py b/module/plugins/hoster/SecureUploadEu.py index 187480973..e8978e658 100644 --- a/module/plugins/hoster/SecureUploadEu.py +++ b/module/plugins/hoster/SecureUploadEu.py @@ -18,7 +18,6 @@ class SecureUploadEu(XFileSharingPro): HOSTER_NAME = "secureupload.eu" FILE_INFO_PATTERN = r'<h3>Downloading (?P<N>[^<]+) \((?P<S>[^<]+)\)</h3>' - OFFLINE_PATTERN = r'The file was removed|File Not Found' getInfo = create_getInfo(SecureUploadEu) diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 13c730b05..999430bc2 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -36,8 +36,8 @@ class TurbobitNet(SimpleHoster): LINK_PATTERN = r'(?P<url>/download/redirect/[^"\']+)' LIMIT_WAIT_PATTERN = r"<div id='timeout'>(\d+)<" - CAPTCHA_KEY_PATTERN = r'src="http://api\.recaptcha\.net/challenge\?k=([^"]+)"' - CAPTCHA_SRC_PATTERN = r'<img alt="Captcha" src="(.+?)"' + + CAPTCHA_URL_PATTERN = r'<img alt="Captcha" src="(.+?)"' def handleFree(self): @@ -71,12 +71,13 @@ class TurbobitNet(SimpleHoster): if inputs['captcha_type'] == 'recaptcha': recaptcha = ReCaptcha(self) - m = re.search(self.CAPTCHA_KEY_PATTERN, self.html) - captcha_key = m.group(1) if m else '6LcTGLoSAAAAAHCWY9TTIrQfjUlxu6kZlTYP50_c' - inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge( - captcha_key) + captcha_key = recaptcha.detect_key() + if captcha_key is None: + self.parseError("ReCaptcha captcha key not found") + + inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge(captcha_key) else: - m = re.search(self.CAPTCHA_SRC_PATTERN, self.html) + m = re.search(self.CAPTCHA_URL_PATTERN, self.html) if m is None: self.parseError('captcha') captcha_url = m.group(1) diff --git a/module/plugins/hoster/UpstoreNet.py b/module/plugins/hoster/UpstoreNet.py index 5293ce01d..cdd1abe76 100644 --- a/module/plugins/hoster/UpstoreNet.py +++ b/module/plugins/hoster/UpstoreNet.py @@ -39,9 +39,9 @@ class UpstoreNet(SimpleHoster): # STAGE 2: solv captcha and wait # first get the infos we need: recaptcha key and wait time recaptcha = ReCaptcha(self) - if not recaptcha.detect_key(self.html): - self.parseError("could not find recaptcha pattern") - self.logDebug("Using captcha key " + recaptcha.recaptcha_key) + if recaptcha.detect_key() is None: + self.parseError("ReCaptcha key not found") + self.logDebug("Using captcha key " + recaptcha.key) # try the captcha 5 times for i in xrange(5): m = re.search(self.WAIT_PATTERN, self.html) diff --git a/module/plugins/hoster/UptoboxCom.py b/module/plugins/hoster/UptoboxCom.py index dec0ef4d9..4363820ce 100644 --- a/module/plugins/hoster/UptoboxCom.py +++ b/module/plugins/hoster/UptoboxCom.py @@ -21,7 +21,6 @@ class UptoboxCom(XFileSharingPro): FILE_INFO_PATTERN = r'"para_title">(?P<N>.+) \((?P<S>[\d.]+) (?P<U>\w+)\)' OFFLINE_PATTERN = r'>(File not found|Access Denied|404 Not Found)' - TEMP_OFFLINE_PATTERN = r'>This server is in maintenance mode' WAIT_PATTERN = r'>(\d+)</span> seconds<' LINK_PATTERN = r'"(https?://\w+\.uptobox\.com/d/.*?)"' diff --git a/module/plugins/hoster/VidPlayNet.py b/module/plugins/hoster/VidPlayNet.py index eb7a13e4c..fce68b29e 100644 --- a/module/plugins/hoster/VidPlayNet.py +++ b/module/plugins/hoster/VidPlayNet.py @@ -19,7 +19,6 @@ class VidPlayNet(XFileSharingPro): HOSTER_NAME = "vidplay.net" - OFFLINE_PATTERN = r'<b>File Not Found</b><br>\s*<br>' FILE_NAME_PATTERN = r'<b>Password:</b></div>\s*<h[1-6]>(?P<N>[^<]+)</h[1-6]>' LINK_PATTERN = r'(http://([^/]*?%s|\d+\.\d+\.\d+\.\d+)(:\d+)?(/d/|(?:/files)?/\d+/\w+/)[^"\'<&]+)' % HOSTER_NAME diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 1c0916541..3625f171e 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -176,7 +176,7 @@ class SimpleHoster(Hoster): example: OFFLINE_PATTERN = r'File (deleted|not found)' TEMP_OFFLINE_PATTERN: Checks if the file is temporarily offline - example: TEMP_OFFLINE_PATTERN = r'Server maintainance' + example: TEMP_OFFLINE_PATTERN = r'Server (maintenance|maintainance)' PREMIUM_ONLY_PATTERN: (optional) Checks if the file can be downloaded only with a premium account example: PREMIUM_ONLY_PATTERN = r'Premium account required' |