diff options
Diffstat (limited to 'module/plugins/accounts')
60 files changed, 257 insertions, 261 deletions
diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index 290343bc1..0647892b0 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -20,8 +20,8 @@ class AlldebridCom(Account): __authors__ = [("Andy Voigt", "spamsales@online.de")] - def load_account_info(self, user, req): - data = self.get_account_data(user) + def parse_info(self, user, password, data, req): + data = self.get_data(user) html = self.load("http://www.alldebrid.com/account/") soup = BeautifulSoup.BeautifulSoup(html) @@ -38,11 +38,11 @@ class AlldebridCom(Account): #: Get expiration date from API except Exception: - data = self.get_account_data(user) + data = self.get_data(user) html = self.load("https://www.alldebrid.com/api.php", get={'action': "info_user", 'login' : user, - 'pw' : data['password']}) + 'pw' : password}) self.log_debug(html) @@ -54,13 +54,13 @@ class AlldebridCom(Account): 'premium' : True } - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load("https://www.alldebrid.com/register/", get={'action' : "login", 'login_login' : user, - 'login_password': data['password']}) + 'login_password': password}) if "This login doesn't exist" in html \ or "The password is not valid" in html \ or "Invalid captcha" in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/BitshareCom.py b/module/plugins/accounts/BitshareCom.py index 98de0cfbb..426468ee6 100644 --- a/module/plugins/accounts/BitshareCom.py +++ b/module/plugins/accounts/BitshareCom.py @@ -14,7 +14,7 @@ class BitshareCom(Account): __authors__ = [("Paul King", None)] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): html = self.load("http://bitshare.com/mysettings.html") if "\"http://bitshare.com/myupgrade.html\">Free" in html: @@ -26,11 +26,11 @@ class BitshareCom(Account): return {'validuntil': -1, 'trafficleft': -1, 'premium': True} - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load("https://bitshare.com/login.html", post={'user' : user, - 'password': data['password'], + 'password': password, 'submit' : "Login"}) if "login" in req.lastEffectiveURL: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/CatShareNet.py b/module/plugins/accounts/CatShareNet.py index 3cda27510..f198561f5 100644 --- a/module/plugins/accounts/CatShareNet.py +++ b/module/plugins/accounts/CatShareNet.py @@ -22,7 +22,7 @@ class CatShareNet(Account): TRAFFIC_LEFT_PATTERN = r'<a href="/premium">([0-9.]+ [kMG]B)' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): premium = False validuntil = -1 trafficleft = -1 @@ -50,12 +50,12 @@ class CatShareNet(Account): return {'premium': premium, 'trafficleft': trafficleft, 'validuntil': validuntil} - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load("http://catshare.net/login", #@TODO: Revert to `https` in 0.4.10 post={'user_email' : user, - 'user_password' : data['password'], + 'user_password' : password, 'remindPassword': 0, 'user[submit]' : "Login"}) if not '<a href="/logout">Wyloguj</a>' in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/CloudzillaTo.py b/module/plugins/accounts/CloudzillaTo.py index 056f72594..b6c65fc8c 100644 --- a/module/plugins/accounts/CloudzillaTo.py +++ b/module/plugins/accounts/CloudzillaTo.py @@ -19,7 +19,7 @@ class CloudzillaTo(Account): PREMIUM_PATTERN = r'<h2>account type</h2>\s*Premium Account' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): html = self.load("http://www.cloudzilla.to/") premium = True if re.search(self.PREMIUM_PATTERN, html) else False @@ -27,11 +27,11 @@ class CloudzillaTo(Account): return {'validuntil': -1, 'trafficleft': -1, 'premium': premium} - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load("https://www.cloudzilla.to/", post={'lusername': user, - 'lpassword': data['password'], + 'lpassword': password, 'w' : "dologin"}) if "ERROR" in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/CzshareCom.py b/module/plugins/accounts/CzshareCom.py index 4b05155b5..4077b5909 100644 --- a/module/plugins/accounts/CzshareCom.py +++ b/module/plugins/accounts/CzshareCom.py @@ -21,7 +21,7 @@ class CzshareCom(Account): CREDIT_LEFT_PATTERN = r'<tr class="active">\s*<td>([\d ,]+) (KiB|MiB|GiB)</td>\s*<td>([^<]*)</td>\s*</tr>' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): premium = False validuntil = None trafficleft = None @@ -44,11 +44,11 @@ class CzshareCom(Account): 'trafficleft': trafficleft} - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load('https://sdilej.cz/index.php', post={'Prihlasit' : "Prihlasit", - "login-password": data['password'], + "login-password": password, "login-name" : user}) if '<div class="login' in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/DebridItaliaCom.py b/module/plugins/accounts/DebridItaliaCom.py index 76ecdd467..cb9771769 100644 --- a/module/plugins/accounts/DebridItaliaCom.py +++ b/module/plugins/accounts/DebridItaliaCom.py @@ -21,7 +21,7 @@ class DebridItaliaCom(Account): WALID_UNTIL_PATTERN = r'Premium valid till: (.+?) \|' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): info = {'premium': False, 'validuntil': None, 'trafficleft': None} html = self.load("http://debriditalia.com/") @@ -36,10 +36,10 @@ class DebridItaliaCom(Account): return info - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load("https://debriditalia.com/login.php", get={'u': user, - 'p': data['password']}) + 'p': password}) if 'NO' in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/DepositfilesCom.py b/module/plugins/accounts/DepositfilesCom.py index 80e565dd6..398a2ac85 100644 --- a/module/plugins/accounts/DepositfilesCom.py +++ b/module/plugins/accounts/DepositfilesCom.py @@ -19,7 +19,7 @@ class DepositfilesCom(Account): ("Walter Purcaro", "vuolter@gmail.com")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): html = self.load("https://dfiles.eu/de/gold/") validuntil = re.search(r"Sie haben Gold Zugang bis: <b>(.*?)</b></div>", html).group(1) @@ -28,11 +28,11 @@ class DepositfilesCom(Account): return {'validuntil': validuntil, 'trafficleft': -1} - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load("https://dfiles.eu/de/login.php", get={'return': "/de/gold/payment.php"}, post={'login' : user, - 'password': data['password']}) + 'password': password}) if r'<div class="error_message">Sie haben eine falsche Benutzername-Passwort-Kombination verwendet.</div>' in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/EuroshareEu.py b/module/plugins/accounts/EuroshareEu.py index 761644d8f..e61b8e853 100644 --- a/module/plugins/accounts/EuroshareEu.py +++ b/module/plugins/accounts/EuroshareEu.py @@ -17,7 +17,7 @@ class EuroshareEu(Account): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): self.relogin(user) html = self.load("http://euroshare.eu/customer-zone/settings/") @@ -32,11 +32,11 @@ class EuroshareEu(Account): return {'validuntil': validuntil, 'trafficleft': -1, 'premium': premium} - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load('http://euroshare.eu/customer-zone/login/', post={'trvale' : "1", 'login' : user, - 'password': data['password']}) + 'password': password}) if u">Nesprávne prihlasovacie meno alebo heslo" in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index dc18290a5..91608c2ae 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -15,8 +15,8 @@ class FastixRu(Account): __authors__ = [("Massimo Rosamilia", "max@spiritix.eu")] - def load_account_info(self, user, req): - data = self.get_account_data(user) + def parse_info(self, user, password, data, req): + data = self.get_data(user) html = json_loads(self.load("http://fastix.ru/api_v2/", get={'apikey': data['api'], 'sub' : "getaccountdetails"})) @@ -31,11 +31,11 @@ class FastixRu(Account): return account_info - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load("https://fastix.ru/api_v2/", get={'sub' : "get_apikey", 'email' : user, - 'password': data['password']}) + 'password': password}) api = json_loads(html) api = api['apikey'] @@ -43,4 +43,4 @@ class FastixRu(Account): data['api'] = api if "error_code" in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/FastshareCz.py b/module/plugins/accounts/FastshareCz.py index 7afbd659e..119e26579 100644 --- a/module/plugins/accounts/FastshareCz.py +++ b/module/plugins/accounts/FastshareCz.py @@ -20,7 +20,7 @@ class FastshareCz(Account): CREDIT_PATTERN = r'Credit\s*:\s*</td>\s*<td>(.+?)\s*<' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): validuntil = -1 trafficleft = None premium = False @@ -38,14 +38,14 @@ class FastshareCz(Account): 'premium' : premium} - def login(self, user, data, req): + def login(self, user, password, data, req): req.cj.setCookie("fastshare.cz", "lang", "en") self.load('http://www.fastshare.cz/login') #@NOTE: Do not remove or it will not login html = self.load("https://www.fastshare.cz/sql.php", post={'login': user, - 'heslo': data['password']}) + 'heslo': password}) if ">Wrong username or password" in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py index 021160f03..fb61e507c 100644 --- a/module/plugins/accounts/FilecloudIo.py +++ b/module/plugins/accounts/FilecloudIo.py @@ -16,11 +16,11 @@ class FilecloudIo(Account): ("stickell", "l.stickell@yahoo.it")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): #: It looks like the first API request always fails, so we retry 5 times, it should work on the second try for _i in xrange(5): rep = self.load("https://secure.filecloud.io/api-fetch_apikey.api", - post={'username': user, 'password': self.get_account_data(user)['password']}) + post={'username': user, 'password': self.get_data(user)['password']}) rep = json_loads(rep) if rep['status'] == "ok": break @@ -42,7 +42,7 @@ class FilecloudIo(Account): return {'premium': False} - def login(self, user, data, req): + def login(self, user, password, data, req): req.cj.setCookie("secure.filecloud.io", "lang", "en") html = self.load('https://secure.filecloud.io/user-login.html') @@ -50,10 +50,10 @@ class FilecloudIo(Account): self.form_data = {} self.form_data['username'] = user - self.form_data['password'] = data['password'] + self.form_password = password html = self.load('https://secure.filecloud.io/user-login_p.html', post=self.form_data) if "you have successfully logged in" not in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/FilefactoryCom.py b/module/plugins/accounts/FilefactoryCom.py index 980a39a11..ee90cfbdf 100644 --- a/module/plugins/accounts/FilefactoryCom.py +++ b/module/plugins/accounts/FilefactoryCom.py @@ -22,7 +22,7 @@ class FilefactoryCom(Account): VALID_UNTIL_PATTERN = r'Premium valid until: <strong>(?P<D>\d{1,2})\w{1,2} (?P<M>\w{3}), (?P<Y>\d{4})</strong>' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): html = self.load("http://www.filefactory.com/account/") m = re.search(self.VALID_UNTIL_PATTERN, html) @@ -37,13 +37,13 @@ class FilefactoryCom(Account): return {'premium': premium, 'trafficleft': -1, 'validuntil': validuntil} - def login(self, user, data, req): + def login(self, user, password, data, req): req.http.c.setopt(pycurl.REFERER, "http://www.filefactory.com/member/login.php") html = self.load("https://www.filefactory.com/member/signin.php", post={'loginEmail' : user, - 'loginPassword': data['password'], + 'loginPassword': password, 'Submit' : "Sign In"}) if req.lastEffectiveURL != "http://www.filefactory.com/account/": - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/FilejungleCom.py b/module/plugins/accounts/FilejungleCom.py index 69fb37a65..5c91c3822 100644 --- a/module/plugins/accounts/FilejungleCom.py +++ b/module/plugins/accounts/FilejungleCom.py @@ -25,7 +25,7 @@ class FilejungleCom(Account): LOGIN_FAILED_PATTERN = r'<span htmlfor="loginUser(Name|Password)" generated="true" class="fail_info">' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): html = self.load(self.URL + "dashboard.php") m = re.search(self.TRAFFIC_LEFT_PATTERN, html) if m: @@ -38,14 +38,14 @@ class FilejungleCom(Account): return {'premium': premium, 'trafficleft': -1, 'validuntil': validuntil} - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load(urlparse.urljoin(self.URL, "login.php"), post={'loginUserName' : user, - 'loginUserPassword' : data['password'], + 'loginUserPassword' : password, 'loginFormSubmit' : "Login", 'recaptcha_challenge_field' : "", 'recaptcha_response_field' : "", 'recaptcha_shortencode_field': ""}) if re.search(self.LOGIN_FAILED_PATTERN, html): - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py index 186568841..c4d06690b 100644 --- a/module/plugins/accounts/FilerNet.py +++ b/module/plugins/accounts/FilerNet.py @@ -23,7 +23,7 @@ class FilerNet(Account): FREE_PATTERN = r'Account Status</th>\s*<td>\s*Free' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): html = self.load("https://filer.net/profile") #: Free user @@ -43,17 +43,17 @@ class FilerNet(Account): return {'premium': False, 'validuntil': None, 'trafficleft': None} - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load("https://filer.net/login") token = re.search(self.TOKEN_PATTERN, html).group(1) html = self.load("https://filer.net/login_check", post={'_username' : user, - '_password' : data['password'], + '_password' : password, '_remember_me': "on", '_csrf_token' : token, '_target_path': "https://filer.net/"}) if 'Logout' not in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/FilesMailRu.py b/module/plugins/accounts/FilesMailRu.py index 50d00f990..a01de48fd 100644 --- a/module/plugins/accounts/FilesMailRu.py +++ b/module/plugins/accounts/FilesMailRu.py @@ -14,18 +14,18 @@ class FilesMailRu(Account): __authors__ = [("RaNaN", "RaNaN@pyload.org")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): return {'validuntil': None, 'trafficleft': None} - def login(self, user, data, req): + def login(self, user, password, data, req): user, domain = user.split("@") html = self.load("https://swa.mail.ru/cgi-bin/auth", post={'Domain' : domain, 'Login' : user, - 'Password': data['password'], + 'Password': password, 'Page' : "http://files.mail.ru/"}) if "Неверное имя пользователя или пароль" in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/FileserveCom.py b/module/plugins/accounts/FileserveCom.py index 5bd129ab7..528bf7e58 100644 --- a/module/plugins/accounts/FileserveCom.py +++ b/module/plugins/accounts/FileserveCom.py @@ -17,12 +17,12 @@ class FileserveCom(Account): __authors__ = [("mkaay", "mkaay@mkaay.de")] - def load_account_info(self, user, req): - data = self.get_account_data(user) + def parse_info(self, user, password, data, req): + data = self.get_data(user) html = self.load("http://app.fileserve.com/api/login/", post={'username': user, - 'password': data['password'], + 'password': password, 'submit': "Submit+Query"}) res = json_loads(html) @@ -33,19 +33,19 @@ class FileserveCom(Account): return {'premium': False, 'trafficleft': None, 'validuntil': None} - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load("http://app.fileserve.com/api/login/", post={'username': user, - 'password': data['password'], + 'password': password, 'submit' : "Submit+Query"}) res = json_loads(html) if not res['type']: - self.wrong_password() + self.fail() #: Login at fileserv html self.load("http://www.fileserve.com/login.php", post={'loginUserName' : user, - 'loginUserPassword': data['password'], + 'loginUserPassword': password, 'autoLogin' : "checked", 'loginFormSubmit' : "Login"}) diff --git a/module/plugins/accounts/FourSharedCom.py b/module/plugins/accounts/FourSharedCom.py index 0084ffd57..448f0e185 100644 --- a/module/plugins/accounts/FourSharedCom.py +++ b/module/plugins/accounts/FourSharedCom.py @@ -15,20 +15,20 @@ class FourSharedCom(Account): ("stickell", "l.stickell@yahoo.it")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): #: Free mode only for now return {'premium': False} - def login(self, user, data, req): + def login(self, user, password, data, req): req.cj.setCookie("4shared.com", "4langcookie", "en") res = self.load("https://www.4shared.com/web/login", post={'login' : user, - 'password' : data['password'], + 'password' : 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.wrong_password() + self.fail() diff --git a/module/plugins/accounts/FreakshareCom.py b/module/plugins/accounts/FreakshareCom.py index 46c70fe67..404e60ee1 100644 --- a/module/plugins/accounts/FreakshareCom.py +++ b/module/plugins/accounts/FreakshareCom.py @@ -17,7 +17,7 @@ class FreakshareCom(Account): __authors__ = [("RaNaN", "RaNaN@pyload.org")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): premium = False validuntil = None trafficleft = None @@ -41,13 +41,13 @@ class FreakshareCom(Account): return {'premium': premium, 'validuntil': validuntil, 'trafficleft': trafficleft} - def login(self, user, data, req): + def login(self, user, password, data, req): self.load("http://freakshare.com/index.php?language=EN") html = self.load("https://freakshare.com/login.html", post={'submit': "Login", 'user' : user, - 'pass' : data['password']}) + 'pass' : password}) if ">Wrong Username or Password" in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/FreeWayMe.py b/module/plugins/accounts/FreeWayMe.py index b370439d0..bfb2747cb 100644 --- a/module/plugins/accounts/FreeWayMe.py +++ b/module/plugins/accounts/FreeWayMe.py @@ -15,7 +15,7 @@ class FreeWayMe(Account): __authors__ = [("Nicolas Giese", "james@free-way.me")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): status = self.get_account_status(user, req) self.log_debug(status) @@ -33,21 +33,21 @@ class FreeWayMe(Account): return account_info - def login(self, user, data, req): + def login(self, user, password, data, req): status = self.get_account_status(user, req) #: Check if user and password are valid if not status: - self.wrong_password() + self.fail() def get_account_status(self, user, req): answer = self.load("http://www.free-way.bz/ajax/jd.php", #@TODO: Revert to `https` in 0.4.10 - get={'id': 4, 'user': user, 'pass': self.get_account_data(user)['password']}) + get={'id': 4, 'user': user, 'pass': self.get_data(user)['password']}) self.log_debug("Login: %s" % answer) if answer == "Invalid login": - self.wrong_password() + self.fail() return json_loads(answer) diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py index 1e2cd5293..7d7359fd0 100644 --- a/module/plugins/accounts/FshareVn.py +++ b/module/plugins/accounts/FshareVn.py @@ -24,7 +24,7 @@ class FshareVn(Account): DIRECT_DOWNLOAD_PATTERN = ur'<input type="checkbox"\s*([^=>]*)[^>]*/>Kích hoạt download trực tiếp</dt>' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): html = self.load("http://www.fshare.vn/account_info.php") if re.search(self.LIFETIME_PATTERN, html): @@ -45,15 +45,15 @@ class FshareVn(Account): return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load("https://www.fshare.vn/login.php", post={'LoginForm[email]' : user, - 'LoginForm[password]' : data['password'], + 'LoginForm[password]' : password, 'LoginForm[rememberMe]': 1, 'yt0' : "Login"}) if not re.search(r'<img\s+alt="VIP"', html): - self.wrong_password() + self.fail() def get_traffic_left(self): diff --git a/module/plugins/accounts/HellshareCz.py b/module/plugins/accounts/HellshareCz.py index 08030895a..7d65d0176 100644 --- a/module/plugins/accounts/HellshareCz.py +++ b/module/plugins/accounts/HellshareCz.py @@ -20,7 +20,7 @@ class HellshareCz(Account): CREDIT_LEFT_PATTERN = r'<div class="credit-link">\s*<table>\s*<tr>\s*<th>(\d+|\d\d\.\d\d\.)</th>' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): self.relogin(user) html = self.load("http://www.hellshare.com/") @@ -52,7 +52,7 @@ class HellshareCz(Account): return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load('http://www.hellshare.com/') if req.lastEffectiveURL != 'http://www.hellshare.com/': #: Switch to English @@ -72,9 +72,9 @@ class HellshareCz(Account): html = self.load("https://www.hellshare.com/login", get={'do': "loginForm-submit"}, post={'login' : "Log in", - 'password' : data['password'], + 'password' : password, 'username' : user, 'perm_login': "on"}) if "<p>You input a wrong user name or wrong password</p>" in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/HighWayMe.py b/module/plugins/accounts/HighWayMe.py index 5f0d971ae..f546c2fe1 100644 --- a/module/plugins/accounts/HighWayMe.py +++ b/module/plugins/accounts/HighWayMe.py @@ -15,7 +15,7 @@ class HighWayMe(Account): __authors__ = [("EvolutionClip", "evolutionclip@live.de")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): premium = False validuntil = -1 trafficleft = None @@ -40,11 +40,11 @@ class HighWayMe(Account): 'trafficleft': trafficleft} - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load("https://high-way.me/api.php?login", post={'login': '1', 'user': user, - 'pass': data['password']}) + 'pass': password}) if 'UserOrPassInvalid' in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/Keep2ShareCc.py b/module/plugins/accounts/Keep2ShareCc.py index 097ae7c7e..3a6100bb3 100644 --- a/module/plugins/accounts/Keep2ShareCc.py +++ b/module/plugins/accounts/Keep2ShareCc.py @@ -24,7 +24,7 @@ class Keep2ShareCc(Account): LOGIN_FAIL_PATTERN = r'Please fix the following input errors' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): validuntil = None trafficleft = -1 premium = False @@ -60,14 +60,14 @@ class Keep2ShareCc(Account): return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} - def login(self, user, data, req): + def login(self, user, password, data, req): req.cj.setCookie("keep2share.cc", "lang", "en") html = self.load("https://keep2share.cc/login.html", post={'LoginForm[username]' : user, - 'LoginForm[password]' : data['password'], + 'LoginForm[password]' : password, 'LoginForm[rememberMe]': 1, 'yt0' : ""}) if re.search(self.LOGIN_FAIL_PATTERN, html): - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/LetitbitNet.py b/module/plugins/accounts/LetitbitNet.py index c4265761a..2d0e1b236 100644 --- a/module/plugins/accounts/LetitbitNet.py +++ b/module/plugins/accounts/LetitbitNet.py @@ -15,9 +15,9 @@ class LetitbitNet(Account): __authors__ = [("stickell", "l.stickell@yahoo.it")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): ## DISABLED BECAUSE IT GET 'key exausted' EVEN IF VALID ## - # api_key = self.get_account_data(user)['password'] + # api_key = self.get_data(user)['password'] # json_data = [api_key, ['key/info']] # api_rep = self.load("http://api.letitbit.net/json", # post={'r': json_dumps(json_data)}) @@ -31,6 +31,6 @@ class LetitbitNet(Account): return {'premium': True} - def login(self, user, data, req): + def login(self, user, password, data, req): #: API_KEY is the username and the PREMIUM_KEY is the password self.log_info(_("You must use your API KEY as username and the PREMIUM KEY as password")) diff --git a/module/plugins/accounts/LinksnappyCom.py b/module/plugins/accounts/LinksnappyCom.py index adad37148..9a90cd79d 100644 --- a/module/plugins/accounts/LinksnappyCom.py +++ b/module/plugins/accounts/LinksnappyCom.py @@ -17,12 +17,12 @@ class LinksnappyCom(Account): __authors__ = [("stickell", "l.stickell@yahoo.it")] - def load_account_info(self, user, req): - data = self.get_account_data(user) + def parse_info(self, user, password, data, req): + data = self.get_data(user) r = self.load('http://gen.linksnappy.com/lseAPI.php', get={'act' : 'USERDETAILS', 'username': user, - 'password': hashlib.md5(data['password']).hexdigest()}) + 'password': hashlib.md5(password).hexdigest()}) self.log_debug("JSON data: " + r) @@ -52,11 +52,11 @@ class LinksnappyCom(Account): 'trafficleft': trafficleft} - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load("https://gen.linksnappy.com/lseAPI.php", get={'act' : 'USERDETAILS', 'username': user, - 'password': hashlib.md5(data['password']).hexdigest()}) + 'password': hashlib.md5(password).hexdigest()}) if "Invalid Account Details" in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/MegaDebridEu.py b/module/plugins/accounts/MegaDebridEu.py index 5fe490ec4..682de4db1 100644 --- a/module/plugins/accounts/MegaDebridEu.py +++ b/module/plugins/accounts/MegaDebridEu.py @@ -19,12 +19,12 @@ class MegaDebridEu(Account): API_URL = "https://www.mega-debrid.eu/api.php" - def load_account_info(self, user, req): - data = self.get_account_data(user) + def parse_info(self, user, password, data, req): + data = self.get_data(user) jsonResponse = self.load(self.API_URL, get={'action' : 'connectUser', 'login' : user, - 'password': data['password']}) + 'password': password}) res = json_loads(jsonResponse) if res['response_code'] == "ok": @@ -34,11 +34,11 @@ class MegaDebridEu(Account): return {'status': False, 'premium': False} - def login(self, user, data, req): + def login(self, user, password, data, req): jsonResponse = self.load(self.API_URL, get={'action' : 'connectUser', 'login' : user, - 'password': data['password']}) + 'password': password}) res = json_loads(jsonResponse) if res['response_code'] != "ok": - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/MegaRapidCz.py b/module/plugins/accounts/MegaRapidCz.py index a0b0f4702..ce2d78994 100644 --- a/module/plugins/accounts/MegaRapidCz.py +++ b/module/plugins/accounts/MegaRapidCz.py @@ -25,12 +25,12 @@ class MegaRapidCz(Account): TRAFFIC_LEFT_PATTERN = r'<tr><td>Kredit</td><td>(.*?) GiB' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): htmll = self.load("http://megarapid.cz/mujucet/") m = re.search(self.LIMITDL_PATTERN, htmll) if m: - data = self.get_account_data(user) + data = self.get_data(user) data['options']['limitDL'] = [int(m.group(1))] m = re.search(self.VALID_UNTIL_PATTERN, htmll) @@ -46,7 +46,7 @@ class MegaRapidCz(Account): return {'premium': False, 'trafficleft': None, 'validuntil': None} - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load("http://megarapid.cz/prihlaseni/") if "Heslo:" in html: @@ -56,6 +56,6 @@ class MegaRapidCz(Account): html = self.load("https://megarapid.cz/prihlaseni/", post={'hash' : hashes, 'login' : user, - 'pass1' : data['password'], + 'pass1' : password, 'remember': 1, 'sbmt' : u"Přihlásit"}) diff --git a/module/plugins/accounts/MegaRapidoNet.py b/module/plugins/accounts/MegaRapidoNet.py index cc2bb5c06..d07df500c 100644 --- a/module/plugins/accounts/MegaRapidoNet.py +++ b/module/plugins/accounts/MegaRapidoNet.py @@ -21,7 +21,7 @@ class MegaRapidoNet(Account): USER_ID_PATTERN = r'<\s*?div[^>]*?class\s*?=\s*?["\']checkbox_compartilhar["\'].*?>.*?<\s*?input[^>]*?name\s*?=\s*?["\']usar["\'].*?>.*?<\s*?input[^>]*?name\s*?=\s*?["\']user["\'][^>]*?value\s*?=\s*?["\'](.*?)\s*?["\']' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): validuntil = None trafficleft = None premium = False @@ -40,16 +40,16 @@ class MegaRapidoNet(Account): 'premium' : premium} - def login(self, user, data, req): + def login(self, user, password, data, req): self.load("http://megarapido.net/login") self.load("http://megarapido.net/painel_user/ajax/logar.php", post={'login': user, - 'senha': data['password']}) + 'senha': password}) html = self.load("http://megarapido.net/gerador") if "sair" not in html.lower(): - self.wrong_password() + self.fail() else: m = re.search(self.USER_ID_PATTERN, html) if m: diff --git a/module/plugins/accounts/MegasharesCom.py b/module/plugins/accounts/MegasharesCom.py index 51c410e1c..ef6724512 100644 --- a/module/plugins/accounts/MegasharesCom.py +++ b/module/plugins/accounts/MegasharesCom.py @@ -20,7 +20,7 @@ class MegasharesCom(Account): VALID_UNTIL_PATTERN = r'<p class="premium_info_box">Period Ends: (\w{3} \d{1,2}, \d{4})</p>' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): # self.relogin(user) html = self.load("http://d01.megashares.com/myms.php") @@ -37,12 +37,12 @@ class MegasharesCom(Account): return {'validuntil': validuntil, 'trafficleft': -1, 'premium': premium} - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load('http://d01.megashares.com/myms_login.php', post={'httpref' : "", 'myms_login' : "Login", 'mymslogin_name': user, - 'mymspassword' : data['password']}) + 'mymspassword' : password}) if not '<span class="b ml">%s</span>' % user in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/MultishareCz.py b/module/plugins/accounts/MultishareCz.py index db8170b47..2bcbae8f8 100644 --- a/module/plugins/accounts/MultishareCz.py +++ b/module/plugins/accounts/MultishareCz.py @@ -20,7 +20,7 @@ class MultishareCz(Account): ACCOUNT_INFO_PATTERN = r'<input type="hidden" id="(u_ID|u_hash)" name=".+?" value="(.+?)">' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): # self.relogin(user) html = self.load("http://www.multishare.cz/profil/") @@ -34,11 +34,11 @@ class MultishareCz(Account): return dict(mms_info, **{'validuntil': -1, 'trafficleft': trafficleft}) - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load('https://www.multishare.cz/html/prihlaseni_process.php', post={'akce' : "Přihlásit", - 'heslo': data['password'], + 'heslo': password, 'jmeno': user}) if '<div class="akce-chyba akce">' in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/MyfastfileCom.py b/module/plugins/accounts/MyfastfileCom.py index 200c61b81..d049b13e6 100644 --- a/module/plugins/accounts/MyfastfileCom.py +++ b/module/plugins/accounts/MyfastfileCom.py @@ -17,7 +17,7 @@ class MyfastfileCom(Account): __authors__ = [("stickell", "l.stickell@yahoo.it")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): if 'days_left' in self.json_data: validuntil = time.time() + self.json_data['days_left'] * 24 * 60 * 60 return {'premium': True, 'validuntil': validuntil, 'trafficleft': -1} @@ -25,15 +25,15 @@ class MyfastfileCom(Account): self.log_error(_("Unable to get account information")) - def login(self, user, data, req): + def login(self, user, password, data, req): #: Password to use is the API-Password written in http://myfastfile.com/myaccount html = self.load("https://myfastfile.com/api.php", get={'user': user, - 'pass': data['password']}) + 'pass': password}) self.log_debug("JSON data: " + html) self.json_data = json_loads(html) if self.json_data['status'] != 'ok': self.log_error(_('Invalid login. The password to use is the API-Password you find in your "My Account" page')) - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/NitroflareCom.py b/module/plugins/accounts/NitroflareCom.py index 5ee434006..f4e9d402a 100644 --- a/module/plugins/accounts/NitroflareCom.py +++ b/module/plugins/accounts/NitroflareCom.py @@ -24,7 +24,7 @@ class NitroflareCom(Account): TOKEN_PATTERN = r'name="token" value="(.+?)"' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): validuntil = -1 trafficleft = None premium = False @@ -67,7 +67,7 @@ class NitroflareCom(Account): 'premium' : premium} - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load("https://nitroflare.com/login") token = re.search(self.TOKEN_PATTERN, html).group(1) @@ -75,8 +75,8 @@ class NitroflareCom(Account): html = self.load("https://nitroflare.com/login", post={'login' : "", 'email' : user, - 'password': data['password'], + 'password': password, 'token' : token}) if re.search(self.LOGIN_FAIL_PATTERN, html): - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index 088d9df69..dfd10c6f7 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -32,7 +32,7 @@ class NoPremiumPl(Account): _pwd = None - def load_account_info(self, name, req): + def parse_info(self, name, req): self._req = req try: result = json_loads(self.run_auth_query()) @@ -54,18 +54,18 @@ class NoPremiumPl(Account): 'premium' : premium } - def login(self, user, data, req): + def login(self, user, password, data, req): self._usr = user - self._pwd = hashlib.sha1(hashlib.md5(data['password']).hexdigest()).hexdigest() + self._pwd = hashlib.sha1(hashlib.md5(password).hexdigest()).hexdigest() self._req = req try: response = json_loads(self.run_auth_query()) except Exception: - self.wrong_password() + self.fail() if "errno" in response.keys(): - self.wrong_password() + self.fail() data['usr'] = self._usr data['pwd'] = self._pwd diff --git a/module/plugins/accounts/NowVideoSx.py b/module/plugins/accounts/NowVideoSx.py index bb64a2e62..8d4add5f6 100644 --- a/module/plugins/accounts/NowVideoSx.py +++ b/module/plugins/accounts/NowVideoSx.py @@ -20,7 +20,7 @@ class NowVideoSx(Account): VALID_UNTIL_PATTERN = r'>Your premium membership expires on: (.+?)<' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): validuntil = None trafficleft = -1 premium = None @@ -48,10 +48,10 @@ class NowVideoSx(Account): return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load("http://www.nowvideo.sx/login.php", post={'user': user, - 'pass': data['password']}) + 'pass': password}) if re.search(r'>Log In<', html): - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/OboomCom.py b/module/plugins/accounts/OboomCom.py index 09e8f8c62..5dc1fcae2 100644 --- a/module/plugins/accounts/OboomCom.py +++ b/module/plugins/accounts/OboomCom.py @@ -32,7 +32,7 @@ class OboomCom(Account): def load_account_data(self, user, req): - passwd = self.get_account_data(user)['password'] + passwd = self.get_data(user)['password'] salt = passwd[::-1] pbkdf2 = PBKDF2(passwd, salt, 1000).hexread(16) @@ -42,12 +42,12 @@ class OboomCom(Account): if not result[0] == 200: self.log_warning(_("Failed to log in: %s") % result[1]) - self.wrong_password() + self.fail() return result[1] - def load_account_info(self, name, req): + def parse_info(self, name, req): account_data = self.load_account_data(name, req) userData = account_data['user'] @@ -76,5 +76,5 @@ class OboomCom(Account): 'session' : session} - def login(self, user, data, req): + def login(self, user, password, data, req): self.load_account_data(user, req) diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py index fa44f050c..2553462ca 100644 --- a/module/plugins/accounts/OneFichierCom.py +++ b/module/plugins/accounts/OneFichierCom.py @@ -22,7 +22,7 @@ class OneFichierCom(Account): VALID_UNTIL_PATTERN = r'Your Premium Status will end the (\d+/\d+/\d+)' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): validuntil = None trafficleft = -1 premium = None @@ -44,15 +44,15 @@ class OneFichierCom(Account): return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium or False} - def login(self, user, data, req): + def login(self, user, password, data, req): req.http.c.setopt(pycurl.REFERER, "https://1fichier.com/login.pl?lg=en") html = self.load("https://1fichier.com/login.pl?lg=en", post={'mail' : user, - 'pass' : data['password'], + 'pass' : password, 'It' : "on", 'purge' : "off", 'valider': "Send"}) if '>Invalid email address' in html or '>Invalid password' in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/OverLoadMe.py b/module/plugins/accounts/OverLoadMe.py index 664b6543f..5e7625244 100644 --- a/module/plugins/accounts/OverLoadMe.py +++ b/module/plugins/accounts/OverLoadMe.py @@ -15,11 +15,11 @@ class OverLoadMe(Account): __authors__ = [("marley", "marley@over-load.me")] - def load_account_info(self, user, req): - data = self.get_account_data(user) + def parse_info(self, user, password, data, req): + data = self.get_data(user) html = self.load("https://api.over-load.me/account.php", get={'user': user, - 'auth': data['password']}).strip() + 'auth': password}).strip() data = json_loads(html) self.log_debug(data) @@ -31,12 +31,12 @@ class OverLoadMe(Account): return {'premium': True, 'validuntil': data['expirationunix'], 'trafficleft': -1} - def login(self, user, data, req): + def login(self, user, password, data, req): jsondata = self.load("https://api.over-load.me/account.php", get={'user': user, - 'auth': data['password']}).strip() + 'auth': password}).strip() data = json_loads(jsondata) if data['err'] == 1: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/PremiumTo.py b/module/plugins/accounts/PremiumTo.py index 248a2aa3c..e25b3b33e 100644 --- a/module/plugins/accounts/PremiumTo.py +++ b/module/plugins/accounts/PremiumTo.py @@ -16,7 +16,7 @@ class PremiumTo(Account): ("stickell", "l.stickell@yahoo.it")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): traffic = self.load("http://premium.to/api/straffic.php", #@TODO: Revert to `https` in 0.4.10 get={'username': self.username, 'password': self.password}) @@ -28,12 +28,12 @@ class PremiumTo(Account): return {'premium': False, 'trafficleft': None, 'validuntil': None} - def login(self, user, data, req): + def login(self, user, password, data, req): self.username = user - self.password = data['password'] + self.password = password authcode = self.load("http://premium.to/api/getauthcode.php", #@TODO: Revert to `https` in 0.4.10 get={'username': user, 'password': self.password}) if "wrong username" in authcode: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/PremiumizeMe.py b/module/plugins/accounts/PremiumizeMe.py index f2b304b69..11a2c648f 100644 --- a/module/plugins/accounts/PremiumizeMe.py +++ b/module/plugins/accounts/PremiumizeMe.py @@ -15,7 +15,7 @@ class PremiumizeMe(Account): __authors__ = [("Florian Franzen", "FlorianFranzen@gmail.com")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): #: Get user data from premiumize.me status = self.get_account_status(user, req) self.log_debug(status) @@ -30,13 +30,13 @@ class PremiumizeMe(Account): return account_info - def login(self, user, data, req): + def login(self, user, password, data, req): #: Get user data from premiumize.me status = self.get_account_status(user, req) #: Check if user and password are valid if status['status'] != 200: - self.wrong_password() + self.fail() def get_account_status(self, user, req): @@ -45,5 +45,5 @@ class PremiumizeMe(Account): answer = self.load("http://api.premiumize.me/pm-api/v1.php", #@TODO: Revert to `https` in 0.4.10 get={'method' : "accountstatus", 'params[login]': user, - 'params[pass]' : self.get_account_data(user)['password']}) + 'params[pass]' : self.get_data(user)['password']}) return json_loads(answer) diff --git a/module/plugins/accounts/QuickshareCz.py b/module/plugins/accounts/QuickshareCz.py index 2cb33136f..b1416d967 100644 --- a/module/plugins/accounts/QuickshareCz.py +++ b/module/plugins/accounts/QuickshareCz.py @@ -19,7 +19,7 @@ class QuickshareCz(Account): TRAFFIC_LEFT_PATTERN = r'Stav kreditu: <strong>(.+?)</strong>' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): html = self.load("http://www.quickshare.cz/premium") m = re.search(self.TRAFFIC_LEFT_PATTERN, html) @@ -33,11 +33,11 @@ class QuickshareCz(Account): return {'validuntil': -1, 'trafficleft': trafficleft, 'premium': premium} - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load('http://www.quickshare.cz/html/prihlaseni_process.php', post={'akce' : u'Přihlásit', - 'heslo': data['password'], + 'heslo': password, 'jmeno': user}) if u'>Takový uživatel neexistuje.<' in html or u'>Špatné heslo.<' in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py index c746d75a4..cd1523a92 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -15,7 +15,7 @@ class RPNetBiz(Account): __authors__ = [("Dman", "dmanugm@gmail.com")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): #: Get account information from rpnet.biz res = self.get_account_status(user, req) try: @@ -33,19 +33,19 @@ class RPNetBiz(Account): return account_info - def login(self, user, data, req): + def login(self, user, password, data, req): #: Get account information from rpnet.biz res = self.get_account_status(user, req) #: If we have an error in the res, we have wrong login information if 'error' in res: - self.wrong_password() + self.fail() def get_account_status(self, user, req): #: Using the rpnet API, check if valid premium account res = self.load("https://premium.rpnet.biz/client_api.php", - get={'username': user, 'password': self.get_account_data(user)['password'], + get={'username': user, 'password': self.get_data(user)['password'], 'action': "showAccountInformation"}) self.log_debug("JSON data: %s" % res) diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index 30b7029ed..6e2c0a134 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -32,7 +32,7 @@ class RapideoPl(Account): _pwd = None - def load_account_info(self, name, req): + def parse_info(self, name, req): self._req = req try: result = json_loads(self.run_auth_query()) @@ -54,18 +54,18 @@ class RapideoPl(Account): 'premium' : premium } - def login(self, user, data, req): + def login(self, user, password, data, req): self._usr = user - self._pwd = hashlib.md5(data['password']).hexdigest() + self._pwd = hashlib.md5(password).hexdigest() self._req = req try: response = json_loads(self.run_auth_query()) except Exception: - self.wrong_password() + self.fail() if "errno" in response.keys(): - self.wrong_password() + self.fail() data['usr'] = self._usr data['pwd'] = self._pwd diff --git a/module/plugins/accounts/RapidgatorNet.py b/module/plugins/accounts/RapidgatorNet.py index 06cdca23e..56f3aa866 100644 --- a/module/plugins/accounts/RapidgatorNet.py +++ b/module/plugins/accounts/RapidgatorNet.py @@ -20,14 +20,14 @@ class RapidgatorNet(Account): API_URL = "http://rapidgator.net/api/user" - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): validuntil = None trafficleft = None premium = False sid = None try: - sid = self.get_account_data(user).get('sid', None) + sid = self.get_data(user).get('sid', None) assert sid html = self.load(urlparse.urljoin(self.API_URL, "info"), @@ -56,11 +56,11 @@ class RapidgatorNet(Account): 'sid' : sid} - def login(self, user, data, req): + def login(self, user, password, data, req): try: html = self.load(urlparse.urljoin(self.API_URL, "login"), post={'username': user, - 'password': data['password']}) + 'password': password}) self.log_debug("API:LOGIN", html) @@ -75,4 +75,4 @@ class RapidgatorNet(Account): except Exception, e: self.log_error(e) - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/RapiduNet.py b/module/plugins/accounts/RapiduNet.py index 738aca14f..29c939602 100644 --- a/module/plugins/accounts/RapiduNet.py +++ b/module/plugins/accounts/RapiduNet.py @@ -26,7 +26,7 @@ class RapiduNet(Account): TRAFFIC_LEFT_PATTERN = r'class="tipsyS"><b>(.+?)<' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): validuntil = None trafficleft = -1 premium = False @@ -47,7 +47,7 @@ class RapiduNet(Account): return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} - def login(self, user, data, req): + def login(self, user, password, data, req): self.load("https://rapidu.net/ajax.php", get={'a': "getChangeLang"}, post={'_go' : "", @@ -57,10 +57,10 @@ class RapiduNet(Account): get={'a': "getUserLogin"}, post={'_go' : "", 'login' : user, - 'pass' : data['password'], + 'pass' : password, 'remember': "1"})) self.log_debug(json) if not json['message'] == "success": - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/RealdebridCom.py b/module/plugins/accounts/RealdebridCom.py index 69ec6668b..c39293ce6 100644 --- a/module/plugins/accounts/RealdebridCom.py +++ b/module/plugins/accounts/RealdebridCom.py @@ -16,7 +16,7 @@ class RealdebridCom(Account): __authors__ = [("Devirex Hazzard", "naibaf_11@yahoo.de")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): if self.pin_code: return @@ -30,15 +30,15 @@ class RealdebridCom(Account): 'premium' : True } - def login(self, user, data, req): + def login(self, user, password, data, req): self.pin_code = False html = self.load("https://real-debrid.com/ajax/login.php", get={'user': user, - 'pass': data['password']}) + 'pass': password}) if "Your login informations are incorrect" in html: - self.wrong_password() + self.fail() elif "PIN Code required" in html: self.log_warning(_("PIN code required. Please login to https://real-debrid.com using the PIN or disable the double authentication in your control panel on https://real-debrid.com")) diff --git a/module/plugins/accounts/RehostTo.py b/module/plugins/accounts/RehostTo.py index 80e8af6a1..1bfd79088 100644 --- a/module/plugins/accounts/RehostTo.py +++ b/module/plugins/accounts/RehostTo.py @@ -14,7 +14,7 @@ class RehostTo(Account): __authors__ = [("RaNaN", "RaNaN@pyload.org")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): premium = False trafficleft = None validuntil = -1 @@ -22,7 +22,7 @@ class RehostTo(Account): html = self.load("https://rehost.to/api.php", get={'cmd' : "login", 'user': user, - 'pass': self.get_account_data(user)['password']}) + 'pass': self.get_data(user)['password']}) try: session = html.split(",")[1].split("=")[1] @@ -46,12 +46,12 @@ class RehostTo(Account): 'session' : session} - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load("https://rehost.to/api.php", get={'cmd': "login", 'user': user, - 'pass': data['password']}) + 'pass': password}) if "ERROR" in html: self.log_debug(html) - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 180838d82..85cdfecd9 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -21,10 +21,10 @@ class ShareonlineBiz(Account): get={'q' : "userdetails", 'aux' : "traffic", 'username': user, - 'password': self.get_account_data(user)['password']}) + 'password': self.get_data(user)['password']}) - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): premium = False validuntil = None trafficleft = -1 @@ -61,9 +61,9 @@ class ShareonlineBiz(Account): 'maxtraffic' : maxtraffic} - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.api_response(user, req) err = re.search(r'\*\*(.+?)\*\*', html) if err: self.log_error(err.group(1).strip()) - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/SimplyPremiumCom.py b/module/plugins/accounts/SimplyPremiumCom.py index 1486578a3..534a75be8 100644 --- a/module/plugins/accounts/SimplyPremiumCom.py +++ b/module/plugins/accounts/SimplyPremiumCom.py @@ -15,7 +15,7 @@ class SimplyPremiumCom(Account): __authors__ = [("EvolutionClip", "evolutionclip@live.de")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): premium = False validuntil = -1 trafficleft = None @@ -38,11 +38,11 @@ class SimplyPremiumCom(Account): return {'premium': premium, 'validuntil': validuntil, 'trafficleft': trafficleft} - def login(self, user, data, req): + def login(self, user, password, data, req): req.cj.setCookie("simply-premium.com", "lang", "EN") html = self.load("https://www.simply-premium.com/login.php", - post={'key': user} if not data['password'] else {'login_name': user, 'login_pass': data['password']}) + post={'key': user} if not password else {'login_name': user, 'login_pass': password}) if 'logout' not in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/SimplydebridCom.py b/module/plugins/accounts/SimplydebridCom.py index 1707efe22..b123021dd 100644 --- a/module/plugins/accounts/SimplydebridCom.py +++ b/module/plugins/accounts/SimplydebridCom.py @@ -16,7 +16,7 @@ class SimplydebridCom(Account): __authors__ = [("Kagenoshin", "kagenoshin@gmx.ch")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): get_data = {'login': 2, 'u': self.loginname, 'p': self.password} res = self.load("http://simply-debrid.com/api.php", get=get_data) data = [x.strip() for x in res.split(";")] @@ -26,11 +26,11 @@ class SimplydebridCom(Account): return {'trafficleft': -1, 'validuntil': time.mktime(time.strptime(str(data[2]), "%d/%m/%Y"))} - def login(self, user, data, req): + def login(self, user, password, data, req): self.loginname = user - self.password = data['password'] + self.password = password get_data = {'login': 1, 'u': self.loginname, 'p': self.password} res = self.load("https://simply-debrid.com/api.php", get=get_data) if res != "02: loggin success": - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/SmoozedCom.py b/module/plugins/accounts/SmoozedCom.py index f3f33eff6..2201e4294 100644 --- a/module/plugins/accounts/SmoozedCom.py +++ b/module/plugins/accounts/SmoozedCom.py @@ -34,7 +34,7 @@ class SmoozedCom(Account): __authors__ = [("", "")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): status = self.get_account_status(user, req) self.log_debug(status) @@ -61,17 +61,17 @@ class SmoozedCom(Account): return info - def login(self, user, data, req): + def login(self, user, password, data, req): #: Get user data from premiumize.me status = self.get_account_status(user, req) #: Check if user and password are valid if status['state'] != 'ok': - self.wrong_password() + self.fail() def get_account_status(self, user, req): - password = self.get_account_data(user)['password'] + password = self.get_data(user)['password'] salt = hashlib.sha256(password).hexdigest() encrypted = PBKDF2(password, salt, iterations=1000).hexread(32) diff --git a/module/plugins/accounts/TurbobitNet.py b/module/plugins/accounts/TurbobitNet.py index a1280f5bf..afed6efbc 100644 --- a/module/plugins/accounts/TurbobitNet.py +++ b/module/plugins/accounts/TurbobitNet.py @@ -17,7 +17,7 @@ class TurbobitNet(Account): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): html = self.load("http://turbobit.net") m = re.search(r'<u>Turbo Access</u> to ([\d.]+)', html) @@ -31,13 +31,13 @@ class TurbobitNet(Account): return {'premium': premium, 'trafficleft': -1, 'validuntil': validuntil} - def login(self, user, data, req): + def login(self, user, password, data, req): req.cj.setCookie("turbobit.net", "user_lang", "en") html = self.load("http://turbobit.net/user/login", post={"user[login]" : user, - "user[pass]" : data['password'], + "user[pass]" : password, "user[submit]": "Login"}) if not '<div class="menu-item user-name">' in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/UlozTo.py b/module/plugins/accounts/UlozTo.py index 6f3cfe225..ed4c11a23 100644 --- a/module/plugins/accounts/UlozTo.py +++ b/module/plugins/accounts/UlozTo.py @@ -21,7 +21,7 @@ class UlozTo(Account): TRAFFIC_LEFT_PATTERN = r'<li class="menu-kredit"><a .*?title=".+?GB = ([\d.]+) MB"' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): html = self.load("http://www.ulozto.net/") m = re.search(self.TRAFFIC_LEFT_PATTERN, html) @@ -32,7 +32,7 @@ class UlozTo(Account): return {'validuntil': -1, 'trafficleft': trafficleft, 'premium': premium} - def login(self, user, data, req): + def login(self, user, password, data, req): login_page = self.load('http://www.ulozto.net/?do=web-login') action = re.findall('<form action="(.+?)"', login_page)[1].replace('&', '&') token = re.search('_token_" value="(.+?)"', login_page).group(1) @@ -41,9 +41,9 @@ class UlozTo(Account): post={'_token_' : token, 'do' : "loginForm-submit", 'login' : u"Přihlásit", - 'password': data['password'], + 'password': password, 'username': user, 'remember': "on"}) if '<div class="flash error">' in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/UploadableCh.py b/module/plugins/accounts/UploadableCh.py index aeb3a241d..e1865bb52 100644 --- a/module/plugins/accounts/UploadableCh.py +++ b/module/plugins/accounts/UploadableCh.py @@ -14,7 +14,7 @@ class UploadableCh(Account): __authors__ = [("Sasch", "gsasch@gmail.com")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): html = self.load("http://www.uploadable.ch/login.php") premium = '<a href="/logout.php"' in html @@ -23,12 +23,12 @@ class UploadableCh(Account): return {'validuntil': None, 'trafficleft': trafficleft, 'premium': premium} #@TODO: validuntil - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load("http://www.uploadable.ch/login.php", post={'userName' : user, - 'userPassword' : data['password'], + 'userPassword' : password, 'autoLogin' : "1", 'action__login': "normalLogin"}) if "Login failed" in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/UploadedTo.py b/module/plugins/accounts/UploadedTo.py index a59394e7f..407658354 100644 --- a/module/plugins/accounts/UploadedTo.py +++ b/module/plugins/accounts/UploadedTo.py @@ -22,7 +22,7 @@ class UploadedTo(Account): TRAFFIC_LEFT_PATTERN = r'<b class="cB">(?P<S>[\d.,]+) (?P<U>[\w^_]+)' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): validuntil = None trafficleft = None premium = None @@ -61,13 +61,13 @@ class UploadedTo(Account): 'premium' : premium} - def login(self, user, data, req): + def login(self, user, password, data, req): #: req.cj.setCookie("uploaded.net", "lang", "en") html = self.load("https://uploaded.net/io/login", post={'id': user, - 'pw': data['password'], + 'pw': password, '_': ""}) if '"err"' in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py index e9bad9273..0b82f0e5a 100644 --- a/module/plugins/accounts/UploadheroCom.py +++ b/module/plugins/accounts/UploadheroCom.py @@ -18,10 +18,10 @@ class UploadheroCom(Account): __authors__ = [("mcmyst", "mcmyst@hotmail.fr")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): premium_pattern = re.compile('Il vous reste <span class="bleu">(\d+)</span> jours premium') - data = self.get_account_data(user) + data = self.get_data(user) html = self.load("http://uploadhero.co/my-account") if premium_pattern.search(html): @@ -34,10 +34,10 @@ class UploadheroCom(Account): return account_info - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load("http://uploadhero.co/lib/connexion.php", post={'pseudo_login': user, - 'password_login': data['password']}) + 'password_login': password}) if "mot de passe invalide" in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/UploadingCom.py b/module/plugins/accounts/UploadingCom.py index d0c497d21..d269abde7 100644 --- a/module/plugins/accounts/UploadingCom.py +++ b/module/plugins/accounts/UploadingCom.py @@ -22,7 +22,7 @@ class UploadingCom(Account): VALID_UNTIL_PATTERN = r'Valid Until:(.+?)<' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): validuntil = None trafficleft = None premium = None @@ -54,7 +54,7 @@ class UploadingCom(Account): 'premium' : premium} - def login(self, user, data, req): + def login(self, user, password, data, req): set_cookies(req.cj, [("uploading.com", "lang" , "1" ), ("uploading.com", "language", "1" ), @@ -64,5 +64,5 @@ class UploadingCom(Account): self.load("http://uploading.com/") self.load("https://uploading.com/general/login_form/?JsHttpRequest=%s-xml" % long(time.time() * 1000), post={'email' : user, - 'password': data['password'], + 'password': password, 'remember': "on"}) diff --git a/module/plugins/accounts/WebshareCz.py b/module/plugins/accounts/WebshareCz.py index 7d0da3cbd..1f2adb7f5 100644 --- a/module/plugins/accounts/WebshareCz.py +++ b/module/plugins/accounts/WebshareCz.py @@ -25,9 +25,9 @@ class WebshareCz(Account): TRAFFIC_LEFT_PATTERN = r'<bytes>(.+)</bytes>' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): html = self.load("https://webshare.cz/api/user_data/", - post={'wst': self.get_account_data(user).get('wst', None)}) + post={'wst': self.get_data(user).get('wst', None)}) self.log_debug("Response: " + html) @@ -41,16 +41,16 @@ class WebshareCz(Account): return {'validuntil': validuntil, 'trafficleft': -1, 'premium': premium} - def login(self, user, data, req): + def login(self, user, password, data, req): salt = self.load("https://webshare.cz/api/salt/", post={'username_or_email': user, 'wst' : ""}) if "<status>OK</status>" not in salt: - self.wrong_password() + self.fail() salt = re.search('<salt>(.+)</salt>', salt).group(1) - password = hashlib.sha1(md5_crypt.encrypt(data['password'], salt=salt)).hexdigest() + password = hashlib.sha1(md5_crypt.encrypt(password, salt=salt)).hexdigest() digest = hashlib.md5(user + ":Webshare:" + password).hexdigest() login = self.load("https://webshare.cz/api/login/", @@ -61,6 +61,6 @@ class WebshareCz(Account): 'wst' : ""}) if "<status>OK</status>" not in login: - self.wrong_password() + self.fail() data['wst'] = re.search('<token>(.+)</token>', login).group(1) diff --git a/module/plugins/accounts/XFileSharingPro.py b/module/plugins/accounts/XFileSharingPro.py index 514dc2bbe..62270a2b0 100644 --- a/module/plugins/accounts/XFileSharingPro.py +++ b/module/plugins/accounts/XFileSharingPro.py @@ -22,11 +22,7 @@ class XFileSharingPro(XFSAccount): return super(XFileSharingPro, self).init() - def load_account_info(self, user, req): - return super(XFileSharingPro if self.HOSTER_DOMAIN else XFSAccount, self).load_account_info(user, req) - - - def login(self, user, data, req): + def login(self, user, password, data, req): if self.HOSTER_DOMAIN: try: return super(XFileSharingPro, self).login(user, data, req) diff --git a/module/plugins/accounts/YibaishiwuCom.py b/module/plugins/accounts/YibaishiwuCom.py index 78e67d4ea..a1886c945 100644 --- a/module/plugins/accounts/YibaishiwuCom.py +++ b/module/plugins/accounts/YibaishiwuCom.py @@ -19,7 +19,7 @@ class YibaishiwuCom(Account): ACCOUNT_INFO_PATTERN = r'var USER_PERMISSION = {(.*?)}' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): # self.relogin(user) html = self.load("http://115.com/") @@ -29,12 +29,12 @@ class YibaishiwuCom(Account): return dict({'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium}) - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load("https://passport.115.com/?ac=login", post={'back' : "http://www.115.com/", 'goto' : "http://115.com/", "login[account]": user, - "login[passwd]" : data['password']}) + "login[passwd]" : password}) if not 'var USER_PERMISSION = {' in html: - self.wrong_password() + self.fail() diff --git a/module/plugins/accounts/ZeveraCom.py b/module/plugins/accounts/ZeveraCom.py index fa4aed8e3..c7c958834 100644 --- a/module/plugins/accounts/ZeveraCom.py +++ b/module/plugins/accounts/ZeveraCom.py @@ -33,7 +33,7 @@ class ZeveraCom(Account): self.API_URL = "http://api.%s/jDownloader.ashx" % (self.HOSTER_DOMAIN or "") - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): validuntil = None trafficleft = None premium = False @@ -48,12 +48,12 @@ class ZeveraCom(Account): return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} - def login(self, user, data, req): + def login(self, user, password, data, req): self.user = user - self.password = data['password'] + self.password = password if self.api_response(req) == "No trafic": - self.wrong_password() + self.fail() def api_response(self, req, just_header=False, **kwargs): |