From c9e31d875d32de31e54959b82bc35eff2b3e0f3f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 10 Nov 2014 00:19:51 +0100 Subject: Code cosmetics --- module/plugins/AccountManager.py | 4 +- module/plugins/Plugin.py | 2 +- module/plugins/PluginManager.py | 2 +- module/plugins/accounts/BayfilesCom.py | 20 +++++----- module/plugins/accounts/DepositfilesCom.py | 10 ++--- module/plugins/accounts/FilecloudIo.py | 2 +- module/plugins/accounts/FourSharedCom.py | 18 ++++----- module/plugins/accounts/HellshareCz.py | 2 +- module/plugins/accounts/Keep2shareCc.py | 4 +- module/plugins/accounts/MegaDebridEu.py | 12 +++--- module/plugins/accounts/MegaRapidCz.py | 8 ++-- module/plugins/accounts/OneFichierCom.py | 2 +- module/plugins/accounts/RPNetBiz.py | 18 ++++----- module/plugins/accounts/RapidshareCom.py | 18 ++++----- module/plugins/accounts/ShareonlineBiz.py | 12 +++--- module/plugins/accounts/SimplyPremiumCom.py | 2 +- module/plugins/accounts/SimplydebridCom.py | 8 ++-- module/plugins/accounts/TurbobitNet.py | 2 +- module/plugins/accounts/UlozTo.py | 2 +- module/plugins/accounts/UnrestrictLi.py | 2 +- module/plugins/accounts/UploadedTo.py | 2 +- module/plugins/accounts/UploadingCom.py | 10 ++--- module/plugins/accounts/ZeveraCom.py | 12 +++--- module/plugins/captcha/captcha.py | 2 +- module/plugins/crypter/DevhostStFolder.py | 2 +- module/plugins/crypter/DuckCryptInfo.py | 12 +++--- module/plugins/crypter/FilefactoryComFolder.py | 2 +- module/plugins/crypter/HoerbuchIn.py | 8 ++-- module/plugins/crypter/LinkCryptWs.py | 8 ++-- module/plugins/crypter/LinkSaveIn.py | 15 ++++++-- module/plugins/crypter/ShareLinksBiz.py | 23 +++++++----- module/plugins/hooks/BypassCaptcha.py | 24 ++++++------ module/plugins/hooks/Captcha9kw.py | 2 +- module/plugins/hooks/CaptchaBrotherhood.py | 34 ++++++++--------- module/plugins/hooks/DeathByCaptcha.py | 46 ++++++++++++----------- module/plugins/hooks/ExpertDecoders.py | 18 ++++----- module/plugins/hooks/ExtractArchive.py | 16 ++++---- module/plugins/hooks/HotFolder.py | 2 +- module/plugins/hooks/IRCInterface.py | 2 +- module/plugins/hooks/ImageTyperz.py | 45 ++++++++++++---------- module/plugins/hooks/LinkdecrypterCom.py | 2 +- module/plugins/hooks/RPNetBiz.py | 6 +-- module/plugins/hooks/XMPPInterface.py | 2 +- module/plugins/hoster/BayfilesCom.py | 12 +++--- module/plugins/hoster/BitshareCom.py | 38 +++++++++---------- module/plugins/hoster/CzshareCom.py | 4 +- module/plugins/hoster/ExtabitCom.py | 8 ++-- module/plugins/hoster/FilecloudIo.py | 24 ++++++------ module/plugins/hoster/FilesMailRu.py | 8 ++-- module/plugins/hoster/FileserveCom.py | 52 +++++++++++++------------- module/plugins/hoster/FourSharedCom.py | 4 +- module/plugins/hoster/Ftp.py | 8 ++-- module/plugins/hoster/LetitbitNet.py | 27 ++++++------- module/plugins/hoster/MegaDebridEu.py | 12 +++--- module/plugins/hoster/MegasharesCom.py | 4 +- module/plugins/hoster/NetloadIn.py | 10 ++--- module/plugins/hoster/RPNetBiz.py | 24 +++++++----- module/plugins/hoster/RapidgatorNet.py | 10 ++--- module/plugins/hoster/RapidshareCom.py | 8 ++-- module/plugins/hoster/ShareonlineBiz.py | 24 ++++++------ module/plugins/hoster/UploadingCom.py | 15 ++++---- module/plugins/hoster/YibaishiwuCom.py | 10 ++--- module/plugins/internal/XFSAccount.py | 10 +++-- 63 files changed, 392 insertions(+), 365 deletions(-) diff --git a/module/plugins/AccountManager.py b/module/plugins/AccountManager.py index b2010019b..4ac62e602 100644 --- a/module/plugins/AccountManager.py +++ b/module/plugins/AccountManager.py @@ -73,7 +73,7 @@ class AccountManager(): return except IOError, e: - self.logError(str(e)) + self.logError(e) return plugin = "" @@ -123,7 +123,7 @@ class AccountManager(): chmod(f.name, 0600) except Exception, e: - self.logError(str(e)) + self.logError(e) #---------------------------------------------------------------------- diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py index a8eca5003..f296533e1 100644 --- a/module/plugins/Plugin.py +++ b/module/plugins/Plugin.py @@ -517,7 +517,7 @@ class Plugin(Base): del frame #: delete the frame or it wont be cleaned f.write(fs_encode(res)) except IOError, e: - self.logError(str(e)) + self.logError(e) if just_header: #parse header diff --git a/module/plugins/PluginManager.py b/module/plugins/PluginManager.py index 82702eb7f..9ef211f35 100644 --- a/module/plugins/PluginManager.py +++ b/module/plugins/PluginManager.py @@ -83,7 +83,7 @@ class PluginManager: pfolder = join(pypath, "module", "plugins", folder) except Exception, e: - self.logCritical(str(e)) + self.logCritical(e) return plugins for f in listdir(pfolder): diff --git a/module/plugins/accounts/BayfilesCom.py b/module/plugins/accounts/BayfilesCom.py index b32003688..b2295c3f1 100644 --- a/module/plugins/accounts/BayfilesCom.py +++ b/module/plugins/accounts/BayfilesCom.py @@ -18,20 +18,20 @@ class BayfilesCom(Account): def loadAccountInfo(self, user, req): for _i in xrange(2): - response = json_loads(req.load("http://api.bayfiles.com/v1/account/info")) - self.logDebug(response) - if not response['error']: + res = json_loads(req.load("http://api.bayfiles.com/v1/account/info")) + self.logDebug(res) + if not res['error']: break - self.logWarning(response['error']) + self.logWarning(res['error']) self.relogin(user) - return {"premium": bool(response['premium']), "trafficleft": -1, - "validuntil": response['expires'] if response['expires'] >= int(time()) else -1} + return {"premium": bool(res['premium']), "trafficleft": -1, + "validuntil": res['expires'] if res['expires'] >= int(time()) else -1} def login(self, user, data, req): - response = json_loads(req.load("http://api.bayfiles.com/v1/account/login/%s/%s" % (user, data['password']))) - self.logDebug(response) - if response['error']: - self.logError(response['error']) + res = json_loads(req.load("http://api.bayfiles.com/v1/account/login/%s/%s" % (user, data['password']))) + self.logDebug(res) + if res['error']: + self.logError(res['error']) self.wrongPassword() diff --git a/module/plugins/accounts/DepositfilesCom.py b/module/plugins/accounts/DepositfilesCom.py index cb4396d02..437265c3f 100644 --- a/module/plugins/accounts/DepositfilesCom.py +++ b/module/plugins/accounts/DepositfilesCom.py @@ -20,8 +20,8 @@ class DepositfilesCom(Account): def loadAccountInfo(self, user, req): - src = req.load("https://dfiles.eu/de/gold/") - validuntil = re.search(r"Sie haben Gold Zugang bis: (.*?)", src).group(1) + html = req.load("https://dfiles.eu/de/gold/") + validuntil = re.search(r"Sie haben Gold Zugang bis: (.*?)", html).group(1) validuntil = int(mktime(strptime(validuntil, "%Y-%m-%d %H:%M:%S"))) @@ -29,7 +29,7 @@ class DepositfilesCom(Account): def login(self, user, data, req): - src = req.load("https://dfiles.eu/de/login.php", get={"return": "/de/gold/payment.php"}, - post={"login": user, "password": data['password']}) - if r'
Sie haben eine falsche Benutzername-Passwort-Kombination verwendet.
' in src: + html = req.load("https://dfiles.eu/de/login.php", get={"return": "/de/gold/payment.php"}, + post={"login": user, "password": data['password']}) + if r'
Sie haben eine falsche Benutzername-Passwort-Kombination verwendet.
' in html: self.wrongPassword() diff --git a/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py index c001d4513..f62d95301 100644 --- a/module/plugins/accounts/FilecloudIo.py +++ b/module/plugins/accounts/FilecloudIo.py @@ -42,7 +42,7 @@ class FilecloudIo(Account): def login(self, user, data, req): - req.cj.setCookie("secure.filecloud.io", "lang", "en") + req.cj.setCookie(".secure.filecloud.io", "lang", "en") html = req.load('https://secure.filecloud.io/user-login.html') if not hasattr(self, "form_data"): diff --git a/module/plugins/accounts/FourSharedCom.py b/module/plugins/accounts/FourSharedCom.py index fe25ccc0e..565a00cf2 100644 --- a/module/plugins/accounts/FourSharedCom.py +++ b/module/plugins/accounts/FourSharedCom.py @@ -21,13 +21,13 @@ class FourSharedCom(Account): def login(self, user, data, req): - req.cj.setCookie("4shared.com", "4langcookie", "en") - response = req.load('http://www.4shared.com/web/login', - post={"login": user, - "password": data['password'], - "remember": "on", - "_remember": "on", - "returnTo": "http://www.4shared.com/account/home.jsp"}) - - if 'Please log in to access your 4shared account' in response: + req.cj.setCookie(".4shared.com", "4langcookie", "en") + res = req.load('http://www.4shared.com/web/login', + post={'login': user, + 'password': data['password'], + 'remember': "on", + '_remember': "on", + 'returnTo': "http://www.4shared.com/account/home.jsp"}) + + if 'Please log in to access your 4shared account' in res: self.wrongPassword() diff --git a/module/plugins/accounts/HellshareCz.py b/module/plugins/accounts/HellshareCz.py index f0692ca5c..685740a5c 100644 --- a/module/plugins/accounts/HellshareCz.py +++ b/module/plugins/accounts/HellshareCz.py @@ -44,7 +44,7 @@ class HellshareCz(Account): trafficleft = int(credit) * 1024 validuntil = -1 except Exception, e: - self.logError(_("Unable to parse credit info"), str(e)) + self.logError(_("Unable to parse credit info"), e) validuntil = -1 trafficleft = -1 diff --git a/module/plugins/accounts/Keep2shareCc.py b/module/plugins/accounts/Keep2shareCc.py index 22682e247..de9b9b5d8 100644 --- a/module/plugins/accounts/Keep2shareCc.py +++ b/module/plugins/accounts/Keep2shareCc.py @@ -39,7 +39,7 @@ class Keep2shareCc(Account): validuntil = mktime(strptime(expiredate, "%Y.%m.%d")) except Exception, e: - self.logError(str(e)) + self.logError(e) else: if validuntil > mktime(gmtime()): @@ -54,7 +54,7 @@ class Keep2shareCc(Account): trafficleft = self.parseTraffic(m.group(1)) except Exception, e: - self.logError(str(e)) + self.logError(e) return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} diff --git a/module/plugins/accounts/MegaDebridEu.py b/module/plugins/accounts/MegaDebridEu.py index b1b3368a6..e7e22048b 100644 --- a/module/plugins/accounts/MegaDebridEu.py +++ b/module/plugins/accounts/MegaDebridEu.py @@ -22,18 +22,18 @@ class MegaDebridEu(Account): data = self.getAccountData(user) jsonResponse = req.load(self.API_URL, get={'action': 'connectUser', 'login': user, 'password': data['password']}) - response = json_loads(jsonResponse) + res = json_loads(jsonResponse) - if response['response_code'] == "ok": - return {"premium": True, "validuntil": float(response['vip_end']), "status": True} + if res['response_code'] == "ok": + return {"premium": True, "validuntil": float(res['vip_end']), "status": True} else: - self.logError(response) + self.logError(res) return {"status": False, "premium": False} def login(self, user, data, req): jsonResponse = req.load(self.API_URL, get={'action': 'connectUser', 'login': user, 'password': data['password']}) - response = json_loads(jsonResponse) - if response['response_code'] != "ok": + res = json_loads(jsonResponse) + if res['response_code'] != "ok": self.wrongPassword() diff --git a/module/plugins/accounts/MegaRapidCz.py b/module/plugins/accounts/MegaRapidCz.py index 440eba8da..41da7ac73 100644 --- a/module/plugins/accounts/MegaRapidCz.py +++ b/module/plugins/accounts/MegaRapidCz.py @@ -25,19 +25,19 @@ class MegaRapidCz(Account): def loadAccountInfo(self, user, req): - src = req.load("http://megarapid.cz/mujucet/", decode=True) + html = req.load("http://megarapid.cz/mujucet/", decode=True) - m = re.search(self.LIMITDL_PATTERN, src) + m = re.search(self.LIMITDL_PATTERN, html) if m: data = self.getAccountData(user) data['options']['limitDL'] = [int(m.group(1))] - m = re.search(self.VALID_UNTIL_PATTERN, src) + m = re.search(self.VALID_UNTIL_PATTERN, html) if m: validuntil = mktime(strptime(m.group(1), "%d.%m.%Y - %H:%M")) return {"premium": True, "trafficleft": -1, "validuntil": validuntil} - m = re.search(self.TRAFFIC_LEFT_PATTERN, src) + m = re.search(self.TRAFFIC_LEFT_PATTERN, html) if m: trafficleft = float(m.group(1)) * (1 << 20) return {"premium": True, "trafficleft": trafficleft, "validuntil": -1} diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py index dae892c05..2f1c914c1 100644 --- a/module/plugins/accounts/OneFichierCom.py +++ b/module/plugins/accounts/OneFichierCom.py @@ -38,7 +38,7 @@ class OneFichierCom(Account): try: validuntil = mktime(strptime(expiredate, "%d/%m/%Y")) except Exception, e: - self.logError(str(e)) + self.logError(e) else: premium = True diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py index 35ad58d2d..4daa56a75 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -16,11 +16,11 @@ class RPNetBiz(Account): def loadAccountInfo(self, user, req): # Get account information from rpnet.biz - response = self.getAccountStatus(user, req) + res = self.getAccountStatus(user, req) try: - if response['accountInfo']['isPremium']: + if res['accountInfo']['isPremium']: # Parse account info. Change the trafficleft later to support per host info. - account_info = {"validuntil": int(response['accountInfo']['premiumExpiry']), + account_info = {"validuntil": int(res['accountInfo']['premiumExpiry']), "trafficleft": -1, "premium": True} else: account_info = {"validuntil": None, "trafficleft": None, "premium": False} @@ -34,18 +34,18 @@ class RPNetBiz(Account): def login(self, user, data, req): # Get account information from rpnet.biz - response = self.getAccountStatus(user, req) + res = self.getAccountStatus(user, req) - # If we have an error in the response, we have wrong login information - if 'error' in response: + # If we have an error in the res, we have wrong login information + if 'error' in res: self.wrongPassword() def getAccountStatus(self, user, req): # Using the rpnet API, check if valid premium account - response = req.load("https://premium.rpnet.biz/client_api.php", + res = req.load("https://premium.rpnet.biz/client_api.php", get={"username": user, "password": self.accounts[user]['password'], "action": "showAccountInformation"}) - self.logDebug("JSON data: %s" % response) + self.logDebug("JSON data: %s" % res) - return json_loads(response) + return json_loads(res) diff --git a/module/plugins/accounts/RapidshareCom.py b/module/plugins/accounts/RapidshareCom.py index c14a56f7d..5c2ce66f5 100644 --- a/module/plugins/accounts/RapidshareCom.py +++ b/module/plugins/accounts/RapidshareCom.py @@ -18,10 +18,10 @@ class RapidshareCom(Account): api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi" api_param_prem = {"sub": "getaccountdetails", "type": "prem", "login": user, "password": data['password'], "withcookie": 1} - src = req.load(api_url_base, cookies=False, get=api_param_prem) - if src.startswith("ERROR"): - raise Exception(src) - fields = src.split("\n") + html = req.load(api_url_base, cookies=False, get=api_param_prem) + if html.startswith("ERROR"): + raise Exception(html) + fields = html.split("\n") info = {} for t in fields: if not t.strip(): @@ -41,10 +41,10 @@ class RapidshareCom(Account): api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi" api_param_prem = {"sub": "getaccountdetails", "type": "prem", "login": user, "password": data['password'], "withcookie": 1} - src = req.load(api_url_base, cookies=False, get=api_param_prem) - if src.startswith("ERROR"): - raise Exception(src + "### Note you have to use your account number for login, instead of name") - fields = src.split("\n") + html = req.load(api_url_base, cookies=False, get=api_param_prem) + if html.startswith("ERROR"): + raise Exception(html + "### Note you have to use your account number for login, instead of name") + fields = html.split("\n") info = {} for t in fields: if not t.strip(): @@ -52,4 +52,4 @@ class RapidshareCom(Account): k, v = t.split("=") info[k] = v cj = self.getAccountCookies(user) - cj.setCookie("rapidshare.com", "enc", info['cookie']) + cj.setCookie(".rapidshare.com", "enc", info['cookie']) diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index b0833f7af..331bb9f74 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -20,19 +20,19 @@ class ShareonlineBiz(Account): def loadAccountInfo(self, user, req): - src = self.getUserAPI(user, req) + html = self.getUserAPI(user, req) info = {} - for line in src.splitlines(): + for line in html.splitlines(): if "=" in line: key, value = line.split("=") info[key] = value self.logDebug(info) if "dl" in info and info['dl'].lower() != "not_available": - req.cj.setCookie("share-online.biz", "dl", info['dl']) + req.cj.setCookie(".share-online.biz", "dl", info['dl']) if "a" in info and info['a'].lower() != "not_available": - req.cj.setCookie("share-online.biz", "a", info['a']) + req.cj.setCookie(".share-online.biz", "a", info['a']) return {"validuntil": int(info['expire_date']) if "expire_date" in info else -1, "trafficleft": -1, @@ -40,6 +40,6 @@ class ShareonlineBiz(Account): def login(self, user, data, req): - src = self.getUserAPI(user, req) - if "EXCEPTION" in src: + html = self.getUserAPI(user, req) + if "EXCEPTION" in html: self.wrongPassword() diff --git a/module/plugins/accounts/SimplyPremiumCom.py b/module/plugins/accounts/SimplyPremiumCom.py index 979ce73aa..ab9474955 100644 --- a/module/plugins/accounts/SimplyPremiumCom.py +++ b/module/plugins/accounts/SimplyPremiumCom.py @@ -33,7 +33,7 @@ class SimplyPremiumCom(Account): def login(self, user, data, req): - req.cj.setCookie("simply-premium.com", "lang", "EN") + req.cj.setCookie(".simply-premium.com", "lang", "EN") if data['password'] == '' or data['password'] == '0': post_data = {"key": user} diff --git a/module/plugins/accounts/SimplydebridCom.py b/module/plugins/accounts/SimplydebridCom.py index 784a90ae3..7979fd5d5 100644 --- a/module/plugins/accounts/SimplydebridCom.py +++ b/module/plugins/accounts/SimplydebridCom.py @@ -17,8 +17,8 @@ class SimplydebridCom(Account): def loadAccountInfo(self, user, req): get_data = {'login': 2, 'u': self.loginname, 'p': self.password} - response = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True) - data = [x.strip() for x in response.split(";")] + res = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True) + data = [x.strip() for x in res.split(";")] if str(data[0]) != "1": return {"premium": False} else: @@ -29,6 +29,6 @@ class SimplydebridCom(Account): self.loginname = user self.password = data['password'] get_data = {'login': 1, 'u': self.loginname, 'p': self.password} - response = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True) - if response != "02: loggin success": + res = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True) + if res != "02: loggin success": self.wrongPassword() diff --git a/module/plugins/accounts/TurbobitNet.py b/module/plugins/accounts/TurbobitNet.py index f87d234a7..b26cad1af 100644 --- a/module/plugins/accounts/TurbobitNet.py +++ b/module/plugins/accounts/TurbobitNet.py @@ -31,7 +31,7 @@ class TurbobitNet(Account): def login(self, user, data, req): - req.cj.setCookie("turbobit.net", "user_lang", "en") + req.cj.setCookie(".turbobit.net", "user_lang", "en") html = req.load("http://turbobit.net/user/login", post={ "user[login]": user, diff --git a/module/plugins/accounts/UlozTo.py b/module/plugins/accounts/UlozTo.py index 178d9a47d..2632d2535 100644 --- a/module/plugins/accounts/UlozTo.py +++ b/module/plugins/accounts/UlozTo.py @@ -23,7 +23,7 @@ class UlozTo(Account): #this cookie gets lost somehow after each request self.phpsessid = req.cj.getCookie("ULOSESSID") html = req.load("http://www.ulozto.net/", decode=True) - req.cj.setCookie("www.ulozto.net", "ULOSESSID", self.phpsessid) + req.cj.setCookie(".ulozto.net", "ULOSESSID", self.phpsessid) m = re.search(self.TRAFFIC_LEFT_PATTERN, html) trafficleft = int(float(m.group(1).replace(' ', '').replace(',', '.')) * 1000 * 1.048) if m else 0 diff --git a/module/plugins/accounts/UnrestrictLi.py b/module/plugins/accounts/UnrestrictLi.py index e43d6bbd7..60e501d2e 100644 --- a/module/plugins/accounts/UnrestrictLi.py +++ b/module/plugins/accounts/UnrestrictLi.py @@ -29,7 +29,7 @@ class UnrestrictLi(Account): def login(self, user, data, req): - req.cj.setCookie("unrestrict.li", "lang", "EN") + req.cj.setCookie(".unrestrict.li", "lang", "EN") html = req.load("https://unrestrict.li/sign_in") if 'solvemedia' in html: diff --git a/module/plugins/accounts/UploadedTo.py b/module/plugins/accounts/UploadedTo.py index 6cb09e44b..2d9d268c9 100644 --- a/module/plugins/accounts/UploadedTo.py +++ b/module/plugins/accounts/UploadedTo.py @@ -51,7 +51,7 @@ class UploadedTo(Account): def login(self, user, data, req): - req.cj.setCookie("uploaded.net", "lang", "en") + req.cj.setCookie(".uploaded.net", "lang", "en") page = req.load("http://uploaded.net/io/login", post={'id': user, 'pw': data['password'], '_': ""}) diff --git a/module/plugins/accounts/UploadingCom.py b/module/plugins/accounts/UploadingCom.py index e9e233a95..8747af133 100644 --- a/module/plugins/accounts/UploadingCom.py +++ b/module/plugins/accounts/UploadingCom.py @@ -40,7 +40,7 @@ class UploadingCom(Account): validuntil = mktime(strptime(expiredate, "%b %d, %Y")) except Exception, e: - self.logError(str(e)) + self.logError(e) else: if validuntil > mktime(gmtime()): @@ -53,10 +53,10 @@ class UploadingCom(Account): def login(self, user, data, req): - set_cookies([("uploading.com", "lang", "1"), - ("uploading.com", "language", "1"), - ("uploading.com", "setlang", "en"), - ("uploading.com", "_lang", "en")] + set_cookies([(".uploading.com", "lang", "1"), + (".uploading.com", "language", "1"), + (".uploading.com", "setlang", "en"), + (".uploading.com", "_lang", "en")] req.load("http://uploading.com/") req.load("http://uploading.com/general/login_form/?JsHttpRequest=%s-xml" % long(time() * 1000), diff --git a/module/plugins/accounts/ZeveraCom.py b/module/plugins/accounts/ZeveraCom.py index 01f9ef692..dbec6984d 100644 --- a/module/plugins/accounts/ZeveraCom.py +++ b/module/plugins/accounts/ZeveraCom.py @@ -43,14 +43,14 @@ class ZeveraCom(Account): } get_data.update(kwargs) - response = req.load("http://www.zevera.com/jDownloader.ashx", get=get_data, + res = req.load("http://www.zevera.com/jDownloader.ashx", get=get_data, decode=True, just_header=just_header) - self.logDebug(response) + self.logDebug(res) - if ':' in response: + if ':' in res: if not just_header: - response = response.replace(',', '\n') + res = res.replace(',', '\n') return dict((y.strip().lower(), z.strip()) for (y, z) in - [x.split(':', 1) for x in response.splitlines() if ':' in x]) + [x.split(':', 1) for x in res.splitlines() if ':' in x]) else: - return response + return res diff --git a/module/plugins/captcha/captcha.py b/module/plugins/captcha/captcha.py index 418c11ffe..b67ce9b9e 100644 --- a/module/plugins/captcha/captcha.py +++ b/module/plugins/captcha/captcha.py @@ -66,7 +66,7 @@ class OCR(object): tmpTxt.close() except IOError, e: - self.logError(str(e)) + self.logError(e) return self.logger.debug("save tiff") diff --git a/module/plugins/crypter/DevhostStFolder.py b/module/plugins/crypter/DevhostStFolder.py index 16931984b..192c5962c 100644 --- a/module/plugins/crypter/DevhostStFolder.py +++ b/module/plugins/crypter/DevhostStFolder.py @@ -48,7 +48,7 @@ class DevhostStFolder(SimpleCrypter): name = folder = m.group(1) except Exception, e: - self.logDebug(str(e)) + self.logDebug(e) name = folder = re.match(self.__pattern__, self.pyfile.url).group('USER') return {'name': name, 'folder': folder} diff --git a/module/plugins/crypter/DuckCryptInfo.py b/module/plugins/crypter/DuckCryptInfo.py index 5bd20711e..07cc5cdc4 100644 --- a/module/plugins/crypter/DuckCryptInfo.py +++ b/module/plugins/crypter/DuckCryptInfo.py @@ -37,11 +37,11 @@ class DuckCryptInfo(Crypter): def handleFolder(self, m): - src = self.load("http://duckcrypt.info/ajax/auth.php?hash=" + str(m.group(2))) - m = re.match(self.__pattern__, src) + html = self.load("http://duckcrypt.info/ajax/auth.php?hash=" + str(m.group(2))) + m = re.match(self.__pattern__, html) self.logDebug("Redirectet to " + str(m.group(0))) - src = self.load(str(m.group(0))) - soup = BeautifulSoup(src) + html = self.load(str(m.group(0))) + soup = BeautifulSoup(html) cryptlinks = soup.findAll("div", attrs={"class": "folderbox"}) self.logDebug("Redirectet to " + str(cryptlinks)) if not cryptlinks: @@ -52,8 +52,8 @@ class DuckCryptInfo(Crypter): def handleLink(self, url): - src = self.load(url) - soup = BeautifulSoup(src) + html = self.load(url) + soup = BeautifulSoup(html) self.urls = [soup.find("iframe")['src']] if not self.urls: self.logInfo(_("No link found")) diff --git a/module/plugins/crypter/FilefactoryComFolder.py b/module/plugins/crypter/FilefactoryComFolder.py index ab4e76092..92e9620f6 100644 --- a/module/plugins/crypter/FilefactoryComFolder.py +++ b/module/plugins/crypter/FilefactoryComFolder.py @@ -21,7 +21,7 @@ class FilefactoryComFolder(SimpleCrypter): NAME_PATTERN = r'

Files in (?P.+)

' PAGES_PATTERN = r'data-paginator-totalPages="(\d+)"' - COOKIES = [('.filefactory.com', 'locale', 'en_US.utf8')] + COOKIES = [(".filefactory.com", "locale", "en_US.utf8")] def loadPage(self, page_n): diff --git a/module/plugins/crypter/HoerbuchIn.py b/module/plugins/crypter/HoerbuchIn.py index ed4adef58..4d4b8fbef 100644 --- a/module/plugins/crypter/HoerbuchIn.py +++ b/module/plugins/crypter/HoerbuchIn.py @@ -30,8 +30,8 @@ class HoerbuchIn(Crypter): self.pyfile = pyfile if self.article.match(pyfile.url): - src = self.load(pyfile.url) - soup = BeautifulSoup(src, convertEntities=BeautifulStoneSoup.HTML_ENTITIES) + html = self.load(pyfile.url) + soup = BeautifulSoup(html, convertEntities=BeautifulStoneSoup.HTML_ENTITIES) abookname = soup.find("a", attrs={"rel": "bookmark"}).text for a in soup.findAll("a", attrs={"href": self.protection}): @@ -50,11 +50,11 @@ class HoerbuchIn(Crypter): url = m.group(0) self.pyfile.url = url - src = self.load(url, post={"viewed": "adpg"}) + html = self.load(url, post={"viewed": "adpg"}) links = [] pattern = re.compile("http://www\.hoerbuch\.in/protection/(\w+)/(.*?)\"") - for hoster, lid in pattern.findall(src): + for hoster, lid in pattern.findall(html): self.req.lastURL = url self.load("http://www.hoerbuch.in/protection/%s/%s" % (hoster, lid)) links.append(self.req.lastEffectiveURL) diff --git a/module/plugins/crypter/LinkCryptWs.py b/module/plugins/crypter/LinkCryptWs.py index 23a8a6512..67b1a3f02 100644 --- a/module/plugins/crypter/LinkCryptWs.py +++ b/module/plugins/crypter/LinkCryptWs.py @@ -216,12 +216,12 @@ class LinkCryptWs(Crypter): try: self.logDebug("Decrypting Web link %d, %s" % (idx + 1, weblink_id)) - response = self.load("http://linkcrypt.ws/out.html", post = {'file':weblink_id}) + res = self.load("http://linkcrypt.ws/out.html", post = {'file':weblink_id}) - indexs = response.find("window.location =") + 19 - indexe = response.find('"', indexs) + indexs = res.find("window.location =") + 19 + indexe = res.find('"', indexs) - link2= response[indexs:indexe] + link2 = res[indexs:indexe] self.logDebug(link2) diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index 72ce32810..7015f2ed3 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -155,18 +155,25 @@ class LinkSaveIn(SimpleCrypter): for i, weblink_id in enumerate(ids): try: webLink = "http://linksave.in/%s" % weblink_id + self.logDebug("Decrypting Web link %d, %s" % (i + 1, webLink)) + fwLink = "http://linksave.in/fw-%s" % weblink_id - response = self.load(fwLink) - jscode = re.findall(r'', response)[-1] + res = self.load(fwLink) + + jscode = re.findall(r'', res)[-1] jseval = self.js.eval("document = { write: function(e) { return e; } }; %s" % jscode) dlLink = re.search(r'http://linksave\.in/dl-\w+', jseval).group(0) self.logDebug("JsEngine returns value [%s] for redirection link" % dlLink) - response = self.load(dlLink) - link = unescape(re.search(r'