From 5deded62d94c04be64d34f6b67d07803eea9b6bf Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Dec 2015 18:43:15 +0100 Subject: Spare code cosmetics --- module/plugins/hoster/AlldebridCom.py | 5 +++-- module/plugins/hoster/BitshareCom.py | 4 ++-- module/plugins/hoster/CatShareNet.py | 4 ++-- module/plugins/hoster/CrockoCom.py | 6 +++--- module/plugins/hoster/DateiTo.py | 6 +++--- module/plugins/hoster/DepositfilesCom.py | 6 +++--- module/plugins/hoster/ExtabitCom.py | 7 ++++--- module/plugins/hoster/FilecloudIo.py | 8 ++++---- module/plugins/hoster/FilepostCom.py | 9 +++++---- module/plugins/hoster/FilerNet.py | 4 ++-- module/plugins/hoster/FileserveCom.py | 15 ++++++++------- module/plugins/hoster/Keep2ShareCc.py | 2 +- module/plugins/hoster/KingfilesNet.py | 4 ++-- module/plugins/hoster/LetitbitNet.py | 4 ++-- module/plugins/hoster/LoadTo.py | 8 ++++---- module/plugins/hoster/LuckyShareNet.py | 16 ++++++++-------- module/plugins/hoster/NitroflareCom.py | 4 ++-- module/plugins/hoster/OboomCom.py | 8 +++----- module/plugins/hoster/PremiumizeMe.py | 11 ++++++----- module/plugins/hoster/RapidgatorNet.py | 8 ++++---- module/plugins/hoster/RapiduNet.py | 4 ++-- module/plugins/hoster/RealdebridCom.py | 11 ++++++----- module/plugins/hoster/SmoozedCom.py | 3 ++- module/plugins/hoster/SoundcloudCom.py | 5 +++-- module/plugins/hoster/TurbobitNet.py | 4 ++-- module/plugins/hoster/UploadableCh.py | 6 +++--- module/plugins/hoster/UploadedTo.py | 4 ++-- module/plugins/hoster/UploadingCom.py | 11 +++++++++-- module/plugins/hoster/UpstoreNet.py | 8 ++++---- module/plugins/hoster/YibaishiwuCom.py | 3 ++- module/plugins/hoster/ZippyshareCom.py | 6 +++--- 31 files changed, 109 insertions(+), 95 deletions(-) (limited to 'module/plugins/hoster') 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 '