From 23ae563604dca1dae262fbc598154b99b2f1eae8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 3 Oct 2014 09:06:05 +0200 Subject: Update plugins after CaptchaService and XFileSharingPro changes --- module/plugins/hoster/BitshareCom.py | 12 +++++++----- module/plugins/hoster/CatShareNet.py | 8 ++++++-- module/plugins/hoster/CrockoCom.py | 13 +++++-------- module/plugins/hoster/DateiTo.py | 8 ++++---- module/plugins/hoster/DepositfilesCom.py | 13 +++---------- module/plugins/hoster/EasybytezCom.py | 2 +- module/plugins/hoster/EgoFilesCom.py | 9 +++++++-- module/plugins/hoster/EpicShareNet.py | 1 - module/plugins/hoster/FilecloudIo.py | 18 +++++++++++------- module/plugins/hoster/FilepostCom.py | 4 ++-- module/plugins/hoster/FilerNet.py | 9 +++++++-- module/plugins/hoster/FilerioCom.py | 2 +- module/plugins/hoster/IfileIt.py | 5 +++-- module/plugins/hoster/Keep2shareCC.py | 9 ++++++--- module/plugins/hoster/KingfilesNet.py | 12 +++++------- module/plugins/hoster/LemUploadsCom.py | 1 - module/plugins/hoster/LetitbitNet.py | 9 +++++++-- module/plugins/hoster/LoadTo.py | 9 ++++----- module/plugins/hoster/LuckyShareNet.py | 8 ++++++-- module/plugins/hoster/MediafireCom.py | 22 +++++++++------------- module/plugins/hoster/MegaFilesSe.py | 2 +- module/plugins/hoster/OboomCom.py | 9 ++++++--- module/plugins/hoster/RapidgatorNet.py | 8 ++++---- module/plugins/hoster/RyushareCom.py | 13 ++++++------- module/plugins/hoster/SecureUploadEu.py | 1 - module/plugins/hoster/TurbobitNet.py | 15 ++++++++------- module/plugins/hoster/UpstoreNet.py | 6 +++--- module/plugins/hoster/UptoboxCom.py | 1 - module/plugins/hoster/VidPlayNet.py | 1 - module/plugins/internal/SimpleHoster.py | 2 +- 30 files changed, 123 insertions(+), 109 deletions(-) (limited to 'module/plugins') 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'
' @@ -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"

Sorry,
the page you're looking for
isn't here.

|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_INPUT_PATTERN = r']* 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'
(?P.+)
\s*(?P[^<]+)' - OFFLINE_PATTERN = r'

File not available

' + 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'

Download Link

\s*]*>([^<]+)' 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 ((?P\d*)m)? ?((?P\d+)s)?' LINK_PATTERN = r'
Download >' - 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'File Not Found

' FILE_NAME_PATTERN = r'Password:\s*

(?P[^<]+)

' 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. |
' 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'

Free Download (?P\S+) (?P[\w.]+) (?P\w+)

' OFFLINE_PATTERN = r'Nicht gefunden' - RECAPTCHA_KEY = "6LcFctISAAAAAAgaeHgyqhNecGJJRnxV1m_vAz3V" LINK_PATTERN = r'href="([^"]+)">Get download' @@ -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'"File Not Found"|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' If it doesn\'t, ' - RECAPTCHA_KEY_PATTERN = r"var __recaptcha_public\s*=\s*'([^']+)';" + RECAPTCHA_PATTERN = r"var __recaptcha_public\s*=\s*'([^']+)';" FILE_INFO_PATTERN = r']*>\s* \s*\s*\s*' TEMP_OFFLINE_PATTERN = r'Downloading of this file is temporarily disabled' @@ -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'File Not Found

' FILE_NAME_PATTERN = r'Password:
\s*

(?P[^<]+)

' 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[^']+)'" - 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'404 Not Found")}) 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"

(?P\S+)

\s*Filesize: (?P[\d.]+)(?P\w+)" 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'
' 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\d+) hour[s]?, )?((?P\d+) minute[s], )?(?P\d+) second[s]' LINK_PATTERN = r'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'

Downloading (?P[^<]+) \((?P[^<]+)\)

' - 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/download/redirect/[^"\']+)' LIMIT_WAIT_PATTERN = r"
(\d+)<" - CAPTCHA_KEY_PATTERN = r'src="http://api\.recaptcha\.net/challenge\?k=([^"]+)"' - CAPTCHA_SRC_PATTERN = r'Captcha(?P.+) \((?P[\d.]+) (?P\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+) 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'File Not Found
\s*
' FILE_NAME_PATTERN = r'Password:
\s*(?P[^<]+)' 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' -- cgit v1.2.3