diff options
Diffstat (limited to 'module/plugins/hoster')
31 files changed, 109 insertions, 95 deletions
diff --git a/module/plugins/hoster/AlldebridCom.py b/module/plugins/hoster/AlldebridCom.py index 6ba2cb4e7..e8a587532 100644 --- a/module/plugins/hoster/AlldebridCom.py +++ b/module/plugins/hoster/AlldebridCom.py @@ -33,8 +33,9 @@ class AlldebridCom(MultiHoster): def handle_premium(self, pyfile): password = self.get_password() - data = json.loads(self.load("http://www.alldebrid.com/service.php", - get={'link': pyfile.url, 'json': "true", 'pw': password})) + html = self.load("http://www.alldebrid.com/service.php", + get={'link': pyfile.url, 'json': "true", 'pw': password}) + data = json.loads(html) self.log_debug("Json data", data) diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py index 9562e0724..951920444 100644 --- a/module/plugins/hoster/BitshareCom.py +++ b/module/plugins/hoster/BitshareCom.py @@ -116,9 +116,9 @@ class BitshareCom(SimpleHoster): #: Resolve captcha if captcha is 1: self.log_debug("File is captcha protected") - recaptcha = ReCaptcha(self.pyfile) + self.captcha = ReCaptcha(self.pyfile) - response, challenge = recaptcha.challenge() + response, challenge = self.captcha.challenge() res = self.load("http://bitshare.com/files-ajax/" + self.file_id + "/request.html", post={'request' : "validateCaptcha", 'ajaxid' : self.ajaxid, diff --git a/module/plugins/hoster/CatShareNet.py b/module/plugins/hoster/CatShareNet.py index 37b194054..0efe0717c 100644 --- a/module/plugins/hoster/CatShareNet.py +++ b/module/plugins/hoster/CatShareNet.py @@ -42,9 +42,9 @@ class CatShareNet(SimpleHoster): def handle_free(self, pyfile): - recaptcha = ReCaptcha(pyfile) + self.captcha = ReCaptcha(pyfile) - response, challenge = recaptcha.challenge() + response, challenge = self.captcha.challenge() self.data = self.load(pyfile.url, post={'recaptcha_challenge_field': challenge, 'recaptcha_response_field' : response}) diff --git a/module/plugins/hoster/CrockoCom.py b/module/plugins/hoster/CrockoCom.py index 59543e6c0..2205759e8 100644 --- a/module/plugins/hoster/CrockoCom.py +++ b/module/plugins/hoster/CrockoCom.py @@ -56,10 +56,10 @@ class CrockoCom(SimpleHoster): action, form = m.groups() inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form)) - recaptcha = ReCaptcha(pyfile) + self.captcha = ReCaptcha(pyfile) - inputs['recaptcha_response_field'], inputs['recaptcha_challenge_field'] = recaptcha.challenge() + inputs['recaptcha_response_field'], inputs['recaptcha_challenge_field'] = self.captcha.challenge() self.download(action, post=inputs) - if self.scan_download({'captcha': recaptcha.KEY_AJAX_PATTERN}): + if self.scan_download({'captcha': self.captcha.KEY_AJAX_PATTERN}): self.retry_captcha() diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 3a584f8c7..a7ffb6548 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -37,7 +37,7 @@ class DateiTo(SimpleHoster): def handle_free(self, pyfile): url = 'http://datei.to/ajax/download.php' data = {'P': 'I', 'ID': self.info['pattern']['ID']} - recaptcha = ReCaptcha(pyfile) + self.captcha = ReCaptcha(pyfile) for _i in xrange(3): self.log_debug("URL", url, "POST", data) @@ -58,8 +58,8 @@ class DateiTo(SimpleHoster): url = 'http://datei.to/' + m.group(1) data = dict(x.split('=') for x in m.group(2).split('&')) - if url.endswith('recaptcha.php'): - data['recaptcha_response_field'], data['recaptcha_challenge_field'] = recaptcha.challenge() + if url.endswith('self.captcha.php'): + data['recaptcha_response_field'], data['recaptcha_challenge_field'] = self.captcha.challenge() else: return diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py index 621d73151..06630d763 100644 --- a/module/plugins/hoster/DepositfilesCom.py +++ b/module/plugins/hoster/DepositfilesCom.py @@ -58,15 +58,15 @@ class DepositfilesCom(SimpleHoster): self.check_errors() - recaptcha = ReCaptcha(pyfile) - captcha_key = recaptcha.detect_key() + self.captcha = ReCaptcha(pyfile) + captcha_key = self.captcha.detect_key() if captcha_key is None: return self.data = self.load("https://dfiles.eu/get_file.php", get=params) if '<input type=button value="Continue" onclick="check_recaptcha' in self.data: - params['response'], params['challenge'] = recaptcha.challenge(captcha_key) + params['response'], params['challenge'] = self.captcha.challenge(captcha_key) self.data = self.load("https://dfiles.eu/get_file.php", get=params) m = re.search(self.LINK_FREE_PATTERN, self.data) diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index 10dd476ca..436d31041 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -52,13 +52,14 @@ class ExtabitCom(SimpleHoster): m = re.search(r'recaptcha/api/challenge\?k=(\w+)', self.data) if m is not None: - recaptcha = ReCaptcha(pyfile) + self.captcha = ReCaptcha(pyfile) captcha_key = m.group(1) get_data = {'type': "recaptcha"} - get_data['capture'], get_data['challenge'] = recaptcha.challenge(captcha_key) + get_data['capture'], get_data['challenge'] = self.captcha.challenge(captcha_key) - res = json.loads(self.load("http://extabit.com/file/%s/" % fileID, get=get_data)) + html = self.load("http://extabit.com/file/%s/" % fileID, get=get_data) + res = json.loads(html) if "ok" in res: self.captcha.correct() diff --git a/module/plugins/hoster/FilecloudIo.py b/module/plugins/hoster/FilecloudIo.py index 7f551ef0c..b245e449d 100644 --- a/module/plugins/hoster/FilecloudIo.py +++ b/module/plugins/hoster/FilecloudIo.py @@ -57,15 +57,15 @@ class FilecloudIo(SimpleHoster): self.error(_("__AB1")) data['__ab1'] = m.group(1) - recaptcha = ReCaptcha(pyfile) + self.captcha = ReCaptcha(pyfile) m = re.search(self.RECAPTCHA_PATTERN, self.data) - captcha_key = m.group(1) if m else recaptcha.detect_key() + captcha_key = m.group(1) if m else self.captcha.detect_key() if captcha_key is None: self.error(_("ReCaptcha key not found")) - response, challenge = recaptcha.challenge(captcha_key) + response, challenge = self.captcha.challenge(captcha_key) self.account.form_data = {'recaptcha_challenge_field': challenge, 'recaptcha_response_field' : response} self.account.relogin() @@ -82,7 +82,7 @@ class FilecloudIo(SimpleHoster): self.log_debug(res) if res['captcha']: data['ctype'] = "recaptcha" - data['recaptcha_response'], data['recaptcha_challenge'] = recaptcha.challenge(captcha_key) + data['recaptcha_response'], data['recaptcha_challenge'] = self.captcha.challenge(captcha_key) json_url = "http://filecloud.io/download-request.json" res = self.load(json_url, post=data) diff --git a/module/plugins/hoster/FilepostCom.py b/module/plugins/hoster/FilepostCom.py index 963bdbac4..c47684522 100644 --- a/module/plugins/hoster/FilepostCom.py +++ b/module/plugins/hoster/FilepostCom.py @@ -77,14 +77,15 @@ class FilepostCom(SimpleHoster): self.link = self.get_json_response(get_dict, post_dict, 'link') if not self.link: - #: Solve recaptcha - recaptcha = ReCaptcha(pyfile) - post_dict['recaptcha_response_field'], post_dict['recaptcha_challenge_field'] = recaptcha.challenge(captcha_key) + #: Solve ReCaptcha + self.captcha = ReCaptcha(pyfile) + post_dict['recaptcha_response_field'], post_dict['recaptcha_challenge_field'] = self.captcha.challenge(captcha_key) self.link = self.get_json_response(get_dict, post_dict, 'link') def get_json_response(self, get_dict, post_dict, field): - res = json.loads(self.load('https://filepost.com/files/get/', get=get_dict, post=post_dict)) + html = self.load('https://filepost.com/files/get/', get=get_dict, post=post_dict) + res = json.loads(html) self.log_debug(res) diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index 7c0b7bb5d..a1ad5d8c9 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -48,8 +48,8 @@ class FilerNet(SimpleHoster): if 'hash' not in inputs: self.error(_("Unable to detect hash")) - recaptcha = ReCaptcha(pyfile) - response, challenge = recaptcha.challenge() + self.captcha = ReCaptcha(pyfile) + response, challenge = self.captcha.challenge() header = self.load(pyfile.url, post={'recaptcha_challenge_field': challenge, diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 58db17381..d682134ee 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -157,13 +157,14 @@ class FileserveCom(Hoster): def do_captcha(self): captcha_key = re.search(self.CAPTCHA_KEY_PATTERN, self.data).group(1) - recaptcha = ReCaptcha(self.pyfile) - - response, challenge = recaptcha.challenge(captcha_key) - res = json.loads(self.load(self.URLS[2], - post={'recaptcha_challenge_field' : challenge, - 'recaptcha_response_field' : response, - 'recaptcha_shortencode_field': self.file_id})) + self.captcha = ReCaptcha(self.pyfile) + + response, challenge = self.captcha.challenge(captcha_key) + html = self.load(self.URLS[2], + post={'recaptcha_challenge_field' : challenge, + 'recaptcha_response_field' : response, + 'recaptcha_shortencode_field': self.file_id}) + res = json.loads(html) if res['success']: self.captcha.correct() else: diff --git a/module/plugins/hoster/Keep2ShareCc.py b/module/plugins/hoster/Keep2ShareCc.py index 8c5cc53cd..43c89176b 100644 --- a/module/plugins/hoster/Keep2ShareCc.py +++ b/module/plugins/hoster/Keep2ShareCc.py @@ -114,7 +114,7 @@ class Keep2ShareCc(SimpleHoster): m = re.search(self.CAPTCHA_PATTERN, self.data) self.log_debug("CAPTCHA_PATTERN found %s" % m) - + if m is not None: captcha_url = urlparse.urljoin("http://keep2s.cc/", m.group(1)) post_data['CaptchaForm[code]'] = self.captcha.decrypt(captcha_url) diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index 14ba59fc7..e1d44d63c 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -51,8 +51,8 @@ class KingfilesNet(SimpleHoster): self.data = self.load(pyfile.url, post=post_data) - solvemedia = SolveMedia(pyfile) - response, challenge = solvemedia.challenge() + self.captcha = SolveMedia(pyfile) + response, challenge = self.captcha.challenge() #: Make the downloadlink appear and load the file m = re.search(self.RAND_ID_PATTERN, self.data) diff --git a/module/plugins/hoster/LetitbitNet.py b/module/plugins/hoster/LetitbitNet.py index 199057b48..805e15bf9 100644 --- a/module/plugins/hoster/LetitbitNet.py +++ b/module/plugins/hoster/LetitbitNet.py @@ -91,8 +91,8 @@ class LetitbitNet(SimpleHoster): self.log_debug(res) - recaptcha = ReCaptcha(pyfile) - response, challenge = recaptcha.challenge() + self.captcha = ReCaptcha(pyfile) + response, challenge = self.captcha.challenge() post_data = {'recaptcha_challenge_field': challenge, 'recaptcha_response_field': response, diff --git a/module/plugins/hoster/LoadTo.py b/module/plugins/hoster/LoadTo.py index af5032b00..d33f1c9ef 100644 --- a/module/plugins/hoster/LoadTo.py +++ b/module/plugins/hoster/LoadTo.py @@ -57,12 +57,12 @@ class LoadTo(SimpleHoster): if m is not None: self.wait(m.group(1)) - #: Load.to is using solvemedia captchas since ~july 2014: - solvemedia = SolveMedia(pyfile) - captcha_key = solvemedia.detect_key() + #: Load.to is using SolveMedia captchas since ~july 2014: + self.captcha = SolveMedia(pyfile) + captcha_key = self.captcha.detect_key() if captcha_key: - response, challenge = solvemedia.challenge(captcha_key) + response, challenge = self.captcha.challenge(captcha_key) self.download(self.link, post={'adcopy_challenge': challenge, 'adcopy_response' : response, diff --git a/module/plugins/hoster/LuckyShareNet.py b/module/plugins/hoster/LuckyShareNet.py index 96fd0f829..1aa5501d5 100644 --- a/module/plugins/hoster/LuckyShareNet.py +++ b/module/plugins/hoster/LuckyShareNet.py @@ -51,14 +51,14 @@ class LuckyShareNet(SimpleHoster): self.log_debug("JSON: " + rep) - jso = self.parse_json(rep) - self.wait(jso['time']) + json_data = self.parse_json(rep) + self.wait(json_data['time']) - recaptcha = ReCaptcha(pyfile) + self.captcha = ReCaptcha(pyfile) - response, challenge = recaptcha.challenge() + response, challenge = self.captcha.challenge() rep = self.load(r"http://luckyshare.net/download/verify/challenge/%s/response/%s/hash/%s" % - (challenge, response, jso['hash'])) + (challenge, response, json_data['hash'])) self.log_debug("JSON: " + rep) @@ -67,6 +67,6 @@ class LuckyShareNet(SimpleHoster): elif 'link' in rep: self.captcha.correct() - jso.update(self.parse_json(rep)) - if jso['link']: - self.link = jso['link'] + json_data.update(self.parse_json(rep)) + if json_data['link']: + self.link = json_data['link'] diff --git a/module/plugins/hoster/NitroflareCom.py b/module/plugins/hoster/NitroflareCom.py index 304b7a87d..09ddc5ba8 100644 --- a/module/plugins/hoster/NitroflareCom.py +++ b/module/plugins/hoster/NitroflareCom.py @@ -57,8 +57,8 @@ class NitroflareCom(SimpleHoster): self.wait(wait_time) - recaptcha = ReCaptcha(pyfile) - response, challenge = recaptcha.challenge(self.RECAPTCHA_KEY) + self.captcha = ReCaptcha(pyfile) + response, challenge = self.captcha.challenge(self.RECAPTCHA_KEY) self.data = self.load("http://nitroflare.com/ajax/freeDownload.php", post={'method' : "fetchDownload", diff --git a/module/plugins/hoster/OboomCom.py b/module/plugins/hoster/OboomCom.py index 340ca170d..bb823256f 100644 --- a/module/plugins/hoster/OboomCom.py +++ b/module/plugins/hoster/OboomCom.py @@ -47,9 +47,7 @@ class OboomCom(Hoster): self.download("http://%s/1.0/dlh" % self.download_domain, get={'ticket': self.download_ticket, 'http_errors': 0}) - def load_url(self, url, get=None): - if get is None: - get = {} + def load_url(self, url, get={}): return json.loads(self.load(url, get)) @@ -74,8 +72,8 @@ class OboomCom(Hoster): def solve_captcha(self): - recaptcha = ReCaptcha(self.pyfile) - response, challenge = recaptcha.challenge(self.RECAPTCHA_KEY) + self.captcha = ReCaptcha(self.pyfile) + response, challenge = self.captcha.challenge(self.RECAPTCHA_KEY) apiUrl = "http://www.oboom.com/1.0/download/ticket" params = {'recaptcha_challenge_field': challenge, diff --git a/module/plugins/hoster/PremiumizeMe.py b/module/plugins/hoster/PremiumizeMe.py index ce909cc64..1f98aa0fe 100644 --- a/module/plugins/hoster/PremiumizeMe.py +++ b/module/plugins/hoster/PremiumizeMe.py @@ -38,11 +38,12 @@ class PremiumizeMe(MultiHoster): user, info = self.account.select() #: Get rewritten link using the premiumize.me api v1 (see https://secure.premiumize.me/?show=api) - data = json.loads(self.load("http://api.premiumize.me/pm-api/v1.php", #@TODO: Revert to `https` in 0.4.10 - get={'method' : "directdownloadlink", - 'params[login]': user, - 'params[pass]' : info['login']['password'], - 'params[link]' : pyfile.url})) + html = self.load("http://api.premiumize.me/pm-api/v1.php", #@TODO: Revert to `https` in 0.4.10 + get={'method' : "directdownloadlink", + 'params[login]': user, + 'params[pass]' : info['login']['password'], + 'params[link]' : pyfile.url}) + data = json.loads(html) #: Check status and decide what to do status = data['status'] diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py index a4f6f4190..27fb4fda0 100644 --- a/module/plugins/hoster/RapidgatorNet.py +++ b/module/plugins/hoster/RapidgatorNet.py @@ -73,9 +73,9 @@ class RapidgatorNet(SimpleHoster): get={'sid': self.sid, 'url': self.pyfile.url}) self.log_debug("API:%s" % cmd, html, "SID: %s" % self.sid) - jso = json.loads(html) - status = jso['response_status'] - msg = jso['response_details'] + json_data = json.loads(html) + status = json_data['response_status'] + msg = json_data['response_details'] except BadHeader, e: self.log_error("API: %s" % cmd, e, "SID: %s" % self.sid) @@ -83,7 +83,7 @@ class RapidgatorNet(SimpleHoster): msg = e if status is 200: - return jso['response'] + return json_data['response'] elif status is 423: self.account.empty() diff --git a/module/plugins/hoster/RapiduNet.py b/module/plugins/hoster/RapiduNet.py index 9a1501c8d..dea828274 100644 --- a/module/plugins/hoster/RapiduNet.py +++ b/module/plugins/hoster/RapiduNet.py @@ -60,8 +60,8 @@ class RapiduNet(SimpleHoster): else: self.wait(int(jsvars['timeToDownload']) - int(time.time())) - recaptcha = ReCaptcha(pyfile) - response, challenge = recaptcha.challenge(self.RECAPTCHA_KEY) + self.captcha = ReCaptcha(pyfile) + response, challenge = self.captcha.challenge(self.RECAPTCHA_KEY) jsvars = self.get_json_response("https://rapidu.net/ajax.php", get={'a': "getCheckCaptcha"}, diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index 8cf9ab8ce..41208df89 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -32,11 +32,12 @@ class RealdebridCom(MultiHoster): def handle_premium(self, pyfile): - data = json.loads(self.load("https://real-debrid.com/ajax/unrestrict.php", - get={'lang' : "en", - 'link' : pyfile.url, - 'password': self.get_password(), - 'time' : int(time.time() * 1000)})) + html = self.load("https://real-debrid.com/ajax/unrestrict.php", + get={'lang' : "en", + 'link' : pyfile.url, + 'password': self.get_password(), + 'time' : int(time.time() * 1000)}) + data = json.loads(html) self.log_debug("Returned Data: %s" % data) diff --git a/module/plugins/hoster/SmoozedCom.py b/module/plugins/hoster/SmoozedCom.py index 73dfd9caf..c2cc1f987 100644 --- a/module/plugins/hoster/SmoozedCom.py +++ b/module/plugins/hoster/SmoozedCom.py @@ -43,7 +43,8 @@ class SmoozedCom(MultiHoster): get_data = {'session_key': self.account.get_data('session'), 'url' : pyfile.url} - data = json.loads(self.load("http://www2.smoozed.com/api/check", get=get_data)) + html = self.load("http://www2.smoozed.com/api/check", get=get_data) + data = json.loads(html) if data['state'] != "ok": self.fail(data['message']) diff --git a/module/plugins/hoster/SoundcloudCom.py b/module/plugins/hoster/SoundcloudCom.py index 6c74840f9..854e98d54 100644 --- a/module/plugins/hoster/SoundcloudCom.py +++ b/module/plugins/hoster/SoundcloudCom.py @@ -42,8 +42,9 @@ class SoundcloudCom(SimpleHoster): client_id = "b45b1aa10f1ac2941910a7f0d10f8e28" #: Url to retrieve the actual song url - streams = json.loads(self.load("https://api.soundcloud.com/tracks/%s/streams" % song_id, - get={'client_id': client_id})) + html = self.load("https://api.soundcloud.com/tracks/%s/streams" % song_id, + get={'client_id': client_id}) + streams = json.loads(html) regex = re.compile(r'[^\d]') http_streams = sorted([(key, value) for key, value in streams.items() if key.startswith('http_')], diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 2cf9a80ad..724ac0916 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -79,8 +79,8 @@ class TurbobitNet(SimpleHoster): self.log_debug(inputs) if inputs['captcha_type'] == "recaptcha": - recaptcha = ReCaptcha(self.pyfile) - inputs['recaptcha_response_field'], inputs['recaptcha_challenge_field'] = recaptcha.challenge() + self.captcha = ReCaptcha(self.pyfile) + inputs['recaptcha_response_field'], inputs['recaptcha_challenge_field'] = self.captcha.challenge() else: m = re.search(self.CAPTCHA_PATTERN, self.data) if m is None: diff --git a/module/plugins/hoster/UploadableCh.py b/module/plugins/hoster/UploadableCh.py index 2122f7837..70ff60eda 100644 --- a/module/plugins/hoster/UploadableCh.py +++ b/module/plugins/hoster/UploadableCh.py @@ -44,13 +44,13 @@ class UploadableCh(SimpleHoster): self.wait(30) - #: Make the recaptcha appear and show it the pyload interface + #: Make the ReCaptcha appear and show it the pyload interface b = self.load(pyfile.url, post={'checkDownload': "check"}) self.log_debug(b) #: Expected output: {'success': "showCaptcha"} - recaptcha = ReCaptcha(pyfile) + self.captcha = ReCaptcha(pyfile) - response, challenge = recaptcha.challenge(self.RECAPTCHA_KEY) + response, challenge = self.captcha.challenge(self.RECAPTCHA_KEY) #: Submit the captcha solution self.load("http://www.uploadable.ch/checkReCaptcha.php", diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index 06f5cb662..2fe1c9744 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -75,8 +75,8 @@ class UploadedTo(SimpleHoster): self.data = self.load("http://uploaded.net/js/download.js") - recaptcha = ReCaptcha(pyfile) - response, challenge = recaptcha.challenge() + self.captcha = ReCaptcha(pyfile) + response, challenge = self.captcha.challenge() self.data = self.load("http://uploaded.net/io/ticket/captcha/%s" % self.info['pattern']['ID'], post={'recaptcha_challenge_field': challenge, diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index f44fc9ea3..d8447e964 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -75,7 +75,10 @@ class UploadingCom(SimpleHoster): self.req.http.c.setopt(pycurl.HTTPHEADER, ["X-Requested-With: XMLHttpRequest"]) self.req.http.lastURL = pyfile.url - res = json.loads(self.load(ajax_url, post={'action': 'second_page', 'code': self.info['pattern']['ID']})) + html = self.load(ajax_url, + post={'action': 'second_page', + 'code' : self.info['pattern']['ID']}) + res = json.loads(html) if 'answer' in res and 'wait_time' in res['answer']: wait_time = int(res['answer']['wait_time']) @@ -84,7 +87,11 @@ class UploadingCom(SimpleHoster): else: self.error(_("No AJAX/WAIT")) - res = json.loads(self.load(ajax_url, post={'action': 'get_link', 'code': self.info['pattern']['ID'], 'pass': 'false'})) + html = self.load(ajax_url, + post={'action': 'get_link', + 'code' : self.info['pattern']['ID'], + 'pass' : 'false'}) + res = json.loads(html) if 'answer' in res and 'link' in res['answer']: url = res['answer']['link'] diff --git a/module/plugins/hoster/UpstoreNet.py b/module/plugins/hoster/UpstoreNet.py index fbf03b7d3..ca8a85c6d 100644 --- a/module/plugins/hoster/UpstoreNet.py +++ b/module/plugins/hoster/UpstoreNet.py @@ -42,8 +42,8 @@ class UpstoreNet(SimpleHoster): self.check_errors() #: STAGE 2: solv captcha and wait - #: First get the infos we need: recaptcha key and wait time - recaptcha = ReCaptcha(pyfile) + #: First get the infos we need: self.captcha key and wait time + self.captcha = ReCaptcha(pyfile) #: Try the captcha 5 times for i in xrange(5): @@ -56,7 +56,7 @@ class UpstoreNet(SimpleHoster): self.wait(wait_time) #: then, handle the captcha - response, challenge = recaptcha.challenge() + response, challenge = self.captcha.challenge() post_data.update({'recaptcha_challenge_field': challenge, 'recaptcha_response_field' : response}) @@ -85,4 +85,4 @@ class UpstoreNet(SimpleHoster): self.wantReconnect = True self.retry(wait_time=3600, reason=_("Upstore doesn't like us today")) - + diff --git a/module/plugins/hoster/YibaishiwuCom.py b/module/plugins/hoster/YibaishiwuCom.py index 9d6e28b79..24c90a856 100644 --- a/module/plugins/hoster/YibaishiwuCom.py +++ b/module/plugins/hoster/YibaishiwuCom.py @@ -41,7 +41,8 @@ class YibaishiwuCom(SimpleHoster): self.log_debug(('FREEUSER' if m.group(2) == "download" else 'GUEST') + ' URL', url) - res = json.loads(self.load(urlparse.urljoin("http://115.com/", url), decode=False)) + html = self.load(urlparse.urljoin("http://115.com/", url), decode=False) + res = json.loads(html) if "urls" in res: mirrors = res['urls'] diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py index 8026fc0ea..b1b084ee8 100644 --- a/module/plugins/hoster/ZippyshareCom.py +++ b/module/plugins/hoster/ZippyshareCom.py @@ -45,13 +45,13 @@ class ZippyshareCom(SimpleHoster): def handle_free(self, pyfile): - recaptcha = ReCaptcha(pyfile) - captcha_key = recaptcha.detect_key() + self.captcha = ReCaptcha(pyfile) + captcha_key = self.captcha.detect_key() if captcha_key: try: self.link = re.search(self.LINK_PREMIUM_PATTERN, self.data) - recaptcha.challenge() + self.captcha.challenge() except Exception, e: self.error(e) |