diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-06-16 17:31:38 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-06-24 22:40:32 +0200 |
commit | c1764e2fea0bb05164c83a876e8cd58b97f58f25 (patch) | |
tree | be1af8dbf5542d93f1cb97f07dd1793fc7acc2df /module/plugins/accounts | |
parent | [SimpleHoster] fixurl (diff) | |
download | pyload-c1764e2fea0bb05164c83a876e8cd58b97f58f25.tar.xz |
Update all
Diffstat (limited to 'module/plugins/accounts')
59 files changed, 193 insertions, 234 deletions
diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index e02983e1c..a109faf4f 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -2,7 +2,7 @@ import re import time -import xml.dom.minidom +import xml.dom.minidom as dom from BeautifulSoup import BeautifulSoup @@ -21,7 +21,7 @@ class AlldebridCom(Account): def loadAccountInfo(self, user, req): data = self.getAccountData(user) - html = req.load("http://www.alldebrid.com/account/") + html = self.load("http://www.alldebrid.com/account/", req=req) soup = BeautifulSoup(html) #Try to parse expiration date directly from the control panel page (better accuracy) @@ -38,12 +38,12 @@ class AlldebridCom(Account): #Get expiration date from API except Exception: data = self.getAccountData(user) - html = req.load("https://www.alldebrid.com/api.php", - get={'action': "info_user", 'login': user, 'pw': data['password']}) + html = self.load("https://www.alldebrid.com/api.php", + get={'action': "info_user", 'login': user, 'pw': data['password']}, req=req) self.logDebug(html) - xml = xml.dom.minidom.parseString(html) + xml = dom.parseString(html) exp_time = time.time() + int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue) * 24 * 60 * 60 return {'validuntil' : exp_time, @@ -52,11 +52,10 @@ class AlldebridCom(Account): def login(self, user, data, req): - html = req.load("https://www.alldebrid.com/register/", + html = self.load("https://www.alldebrid.com/register/", get={'action' : "login", 'login_login' : user, - 'login_password': data['password']}, - decode=True) + 'login_password': data['password']}, req=req) if "This login doesn't exist" in html \ or "The password is not valid" in html \ diff --git a/module/plugins/accounts/BitshareCom.py b/module/plugins/accounts/BitshareCom.py index afbed2920..8f748b9e9 100644 --- a/module/plugins/accounts/BitshareCom.py +++ b/module/plugins/accounts/BitshareCom.py @@ -14,7 +14,7 @@ class BitshareCom(Account): def loadAccountInfo(self, user, req): - html = req.load("http://bitshare.com/mysettings.html") + html = self.load("http://bitshare.com/mysettings.html", req=req) if "\"http://bitshare.com/myupgrade.html\">Free" in html: return {"validuntil": -1, "trafficleft": -1, "premium": False} @@ -26,9 +26,8 @@ class BitshareCom(Account): def login(self, user, data, req): - html = req.load("https://bitshare.com/login.html", - post={"user": user, "password": data['password'], "submit": "Login"}, - decode=True) + html = self.load("https://bitshare.com/login.html", + post={"user": user, "password": data['password'], "submit": "Login"}, req=req) if "login" in req.lastEffectiveURL: self.wrongPassword() diff --git a/module/plugins/accounts/CatShareNet.py b/module/plugins/accounts/CatShareNet.py index ae2b69dfa..79e94cc17 100644 --- a/module/plugins/accounts/CatShareNet.py +++ b/module/plugins/accounts/CatShareNet.py @@ -26,7 +26,7 @@ class CatShareNet(Account): validuntil = -1 trafficleft = -1 - html = req.load("http://catshare.net/", decode=True) + html = self.load("http://catshare.net/", req=req) if re.search(self.PREMIUM_PATTERN, html): premium = True @@ -50,12 +50,11 @@ class CatShareNet(Account): def login(self, user, data, req): - html = req.load("http://catshare.net/login", #@TODO: Revert to `https` in 0.4.10 + html = self.load("http://catshare.net/login", #@TODO: Revert to `https` in 0.4.10 post={'user_email': user, 'user_password': data['password'], 'remindPassword': 0, - 'user[submit]': "Login"}, - decode=True) + 'user[submit]': "Login"}, req=req) if not '<a href="/logout">Wyloguj</a>' in html: self.wrongPassword() diff --git a/module/plugins/accounts/CloudzillaTo.py b/module/plugins/accounts/CloudzillaTo.py index 48e0fd5c3..2328b0a86 100644 --- a/module/plugins/accounts/CloudzillaTo.py +++ b/module/plugins/accounts/CloudzillaTo.py @@ -19,7 +19,7 @@ class CloudzillaTo(Account): def loadAccountInfo(self, user, req): - html = req.load("http://www.cloudzilla.to/") + html = self.load("http://www.cloudzilla.to/", req=req) premium = True if re.search(self.PREMIUM_PATTERN, html) else False @@ -27,11 +27,10 @@ class CloudzillaTo(Account): def login(self, user, data, req): - html = req.load("https://www.cloudzilla.to/", + html = self.load("https://www.cloudzilla.to/", post={'lusername': user, 'lpassword': data['password'], - 'w' : "dologin"}, - decode=True) + 'w' : "dologin"}, req=req) if "ERROR" in html: self.wrongPassword() diff --git a/module/plugins/accounts/CzshareCom.py b/module/plugins/accounts/CzshareCom.py index 67869551a..c53c1807b 100644 --- a/module/plugins/accounts/CzshareCom.py +++ b/module/plugins/accounts/CzshareCom.py @@ -25,7 +25,7 @@ class CzshareCom(Account): validuntil = None trafficleft = None - html = req.load("http://sdilej.cz/prehled_kreditu/") + html = self.load("http://sdilej.cz/prehled_kreditu/", req=req) try: m = re.search(self.CREDIT_LEFT_PATTERN, html) @@ -44,11 +44,10 @@ class CzshareCom(Account): def login(self, user, data, req): - html = req.load('https://sdilej.cz/index.php', + html = self.load('https://sdilej.cz/index.php', post={"Prihlasit": "Prihlasit", "login-password": data['password'], - "login-name": user}, - decode=True) + "login-name": user}, req=req) if '<div class="login' in html: self.wrongPassword() diff --git a/module/plugins/accounts/DebridItaliaCom.py b/module/plugins/accounts/DebridItaliaCom.py index 4fe4fcecc..defa1a313 100644 --- a/module/plugins/accounts/DebridItaliaCom.py +++ b/module/plugins/accounts/DebridItaliaCom.py @@ -22,7 +22,7 @@ class DebridItaliaCom(Account): def loadAccountInfo(self, user, req): info = {"premium": False, "validuntil": None, "trafficleft": None} - html = req.load("http://debriditalia.com/") + html = self.load("http://debriditalia.com/", req=req) if 'Account premium not activated' not in html: m = re.search(self.WALID_UNTIL_PATTERN, html) @@ -36,9 +36,8 @@ class DebridItaliaCom(Account): def login(self, user, data, req): - html = req.load("https://debriditalia.com/login.php", - get={'u': user, 'p': data['password']}, - decode=True) + html = self.load("https://debriditalia.com/login.php", + get={'u': user, 'p': data['password']}, req=req) if 'NO' in html: self.wrongPassword() diff --git a/module/plugins/accounts/DepositfilesCom.py b/module/plugins/accounts/DepositfilesCom.py index 234ad0b7a..e89f0add8 100644 --- a/module/plugins/accounts/DepositfilesCom.py +++ b/module/plugins/accounts/DepositfilesCom.py @@ -19,7 +19,7 @@ class DepositfilesCom(Account): def loadAccountInfo(self, user, req): - html = req.load("https://dfiles.eu/de/gold/") + html = self.load("https://dfiles.eu/de/gold/", req=req) validuntil = re.search(r"Sie haben Gold Zugang bis: <b>(.*?)</b></div>", html).group(1) validuntil = time.mktime(time.strptime(validuntil, "%Y-%m-%d %H:%M:%S")) @@ -28,9 +28,8 @@ class DepositfilesCom(Account): def login(self, user, data, req): - html = req.load("https://dfiles.eu/de/login.php", get={"return": "/de/gold/payment.php"}, - post={"login": user, "password": data['password']}, - decode=True) + html = self.load("https://dfiles.eu/de/login.php", get={"return": "/de/gold/payment.php"}, + post={"login": user, "password": data['password']}, req=req) if r'<div class="error_message">Sie haben eine falsche Benutzername-Passwort-Kombination verwendet.</div>' in html: self.wrongPassword() diff --git a/module/plugins/accounts/EuroshareEu.py b/module/plugins/accounts/EuroshareEu.py index 0568b9c4f..4af9803b7 100644 --- a/module/plugins/accounts/EuroshareEu.py +++ b/module/plugins/accounts/EuroshareEu.py @@ -18,7 +18,7 @@ class EuroshareEu(Account): def loadAccountInfo(self, user, req): self.relogin(user) - html = req.load("http://euroshare.eu/customer-zone/settings/") + html = self.load("http://euroshare.eu/customer-zone/settings/", req=req) m = re.search('id="input_expire_date" value="(\d+\.\d+\.\d+ \d+:\d+)"', html) if m is None: @@ -32,11 +32,10 @@ class EuroshareEu(Account): def login(self, user, data, req): - html = req.load('http://euroshare.eu/customer-zone/login/', + html = self.load('http://euroshare.eu/customer-zone/login/', post={"trvale": "1", "login": user, - "password": data['password']}, - decode=True) + "password": data['password']}, req=req) if u">Nesprávne prihlasovacie meno alebo heslo" in html: self.wrongPassword() diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index c83964feb..dedbc0d5d 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -16,7 +16,7 @@ class FastixRu(Account): def loadAccountInfo(self, user, req): data = self.getAccountData(user) - html = json_loads(req.load("http://fastix.ru/api_v2/", get={'apikey': data['api'], 'sub': "getaccountdetails"})) + html = json_loads(self.load("http://fastix.ru/api_v2/", get={'apikey': data['api'], 'sub': "getaccountdetails"}), req=req) points = html['points'] kb = float(points) * 1024 ** 2 / 1000 @@ -29,8 +29,8 @@ class FastixRu(Account): def login(self, user, data, req): - html = req.load("https://fastix.ru/api_v2/", - get={'sub': "get_apikey", 'email': user, 'password': data['password']}) + html = self.load("https://fastix.ru/api_v2/", + get={'sub': "get_apikey", 'email': user, 'password': data['password']}, req=req) api = json_loads(html) api = api['apikey'] diff --git a/module/plugins/accounts/FastshareCz.py b/module/plugins/accounts/FastshareCz.py index e291d5859..d1d79f7b1 100644 --- a/module/plugins/accounts/FastshareCz.py +++ b/module/plugins/accounts/FastshareCz.py @@ -24,7 +24,7 @@ class FastshareCz(Account): trafficleft = None premium = False - html = req.load("http://www.fastshare.cz/user", decode=True) + html = self.load("http://www.fastshare.cz/user", req=req) m = re.search(self.CREDIT_PATTERN, html) if m: @@ -40,11 +40,10 @@ class FastshareCz(Account): def login(self, user, data, req): req.cj.setCookie("fastshare.cz", "lang", "en") - req.load('http://www.fastshare.cz/login') # Do not remove or it will not login + self.load('http://www.fastshare.cz/login', req=req) # Do not remove or it will not login - html = req.load("https://www.fastshare.cz/sql.php", - post={'login': user, 'heslo': data['password']}, - decode=True) + html = self.load("https://www.fastshare.cz/sql.php", + post={'login': user, 'heslo': data['password']}, req=req) if ">Wrong username or password" in html: self.wrongPassword() diff --git a/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py index c5239405e..300159acf 100644 --- a/module/plugins/accounts/FilecloudIo.py +++ b/module/plugins/accounts/FilecloudIo.py @@ -18,7 +18,7 @@ class FilecloudIo(Account): def loadAccountInfo(self, user, 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 = req.load("https://secure.filecloud.io/api-fetch_apikey.api", + rep = self.load("https://secure.filecloud.io/api-fetch_apikey.api", post={"username": user, "password": self.getAccountData(user)['password']}) rep = json_loads(rep) if rep['status'] == 'ok': @@ -31,8 +31,8 @@ class FilecloudIo(Account): akey = rep['akey'] self.accounts[user]['akey'] = akey # Saved for hoster plugin - rep = req.load("http://api.filecloud.io/api-fetch_account_details.api", - post={"akey": akey}) + rep = self.load("http://api.filecloud.io/api-fetch_account_details.api", + post={"akey": akey}, req=req) rep = json_loads(rep) if rep['is_premium'] == 1: @@ -43,7 +43,7 @@ class FilecloudIo(Account): def login(self, user, data, req): req.cj.setCookie("secure.filecloud.io", "lang", "en") - html = req.load('https://secure.filecloud.io/user-login.html') + html = self.load('https://secure.filecloud.io/user-login.html', req=req) if not hasattr(self, "form_data"): self.form_data = {} @@ -51,9 +51,9 @@ class FilecloudIo(Account): self.form_data['username'] = user self.form_data['password'] = data['password'] - html = req.load('https://secure.filecloud.io/user-login_p.html', - post=self.form_data, - multipart=True) + html = self.load('https://secure.filecloud.io/user-login_p.html', + post=self.form_data, + req=req) if "you have successfully logged in" not in html: self.wrongPassword() diff --git a/module/plugins/accounts/FilefactoryCom.py b/module/plugins/accounts/FilefactoryCom.py index e56708831..9d61ea927 100644 --- a/module/plugins/accounts/FilefactoryCom.py +++ b/module/plugins/accounts/FilefactoryCom.py @@ -22,7 +22,7 @@ class FilefactoryCom(Account): def loadAccountInfo(self, user, req): - html = req.load("http://www.filefactory.com/account/") + html = self.load("http://www.filefactory.com/account/", req=req) m = re.search(self.VALID_UNTIL_PATTERN, html) if m: @@ -39,10 +39,10 @@ class FilefactoryCom(Account): def login(self, user, data, req): req.http.c.setopt(pycurl.REFERER, "http://www.filefactory.com/member/login.php") - html = req.load("https://www.filefactory.com/member/signin.php", + html = self.load("https://www.filefactory.com/member/signin.php", post={"loginEmail" : user, "loginPassword": data['password'], - "Submit" : "Sign In"}) + "Submit" : "Sign In"}, req=req) if req.lastEffectiveURL != "http://www.filefactory.com/account/": self.wrongPassword() diff --git a/module/plugins/accounts/FilejungleCom.py b/module/plugins/accounts/FilejungleCom.py index efeeaceb7..459c70c95 100644 --- a/module/plugins/accounts/FilejungleCom.py +++ b/module/plugins/accounts/FilejungleCom.py @@ -24,7 +24,7 @@ class FilejungleCom(Account): def loadAccountInfo(self, user, req): - html = req.load(self.URL + "dashboard.php") + html = self.load(self.URL + "dashboard.php", req=req) m = re.search(self.TRAFFIC_LEFT_PATTERN, html) if m: premium = True @@ -37,14 +37,13 @@ class FilejungleCom(Account): def login(self, user, data, req): - html = req.load(self.URL + "login.php", + html = self.load(self.URL + "login.php", post={"loginUserName": user, "loginUserPassword": data['password'], "loginFormSubmit": "Login", "recaptcha_challenge_field": "", "recaptcha_response_field": "", - "recaptcha_shortencode_field": ""}, - decode=True) + "recaptcha_shortencode_field": ""}, req=req) if re.search(self.LOGIN_FAILED_PATTERN, html): self.wrongPassword() diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py index f77ac5197..aca09a7ed 100644 --- a/module/plugins/accounts/FilerNet.py +++ b/module/plugins/accounts/FilerNet.py @@ -23,7 +23,7 @@ class FilerNet(Account): def loadAccountInfo(self, user, req): - html = req.load("https://filer.net/profile") + html = self.load("https://filer.net/profile", req=req) # Free user if re.search(self.FREE_PATTERN, html): @@ -43,17 +43,16 @@ class FilerNet(Account): def login(self, user, data, req): - html = req.load("https://filer.net/login", decode=True) + html = self.load("https://filer.net/login", req=req) token = re.search(self.TOKEN_PATTERN, html).group(1) - html = req.load("https://filer.net/login_check", + html = self.load("https://filer.net/login_check", post={"_username" : user, "_password" : data['password'], "_remember_me": "on", "_csrf_token" : token, - "_target_path": "https://filer.net/"}, - decode=True) + "_target_path": "https://filer.net/"}, req=req) if 'Logout' not in html: self.wrongPassword() diff --git a/module/plugins/accounts/FilesMailRu.py b/module/plugins/accounts/FilesMailRu.py index 3f9068fff..a1f86f7b5 100644 --- a/module/plugins/accounts/FilesMailRu.py +++ b/module/plugins/accounts/FilesMailRu.py @@ -20,12 +20,11 @@ class FilesMailRu(Account): def login(self, user, data, req): user, domain = user.split("@") - html = req.load("https://swa.mail.ru/cgi-bin/auth", + html = self.load("https://swa.mail.ru/cgi-bin/auth", post={"Domain": domain, "Login": user, "Password": data['password'], - "Page": "http://files.mail.ru/"}, - decode=True) + "Page": "http://files.mail.ru/"}, req=req) if "Неверное имя пользователя или пароль" in html: self.wrongPassword() diff --git a/module/plugins/accounts/FileserveCom.py b/module/plugins/accounts/FileserveCom.py index 38e21e246..bda6efc8d 100644 --- a/module/plugins/accounts/FileserveCom.py +++ b/module/plugins/accounts/FileserveCom.py @@ -19,8 +19,8 @@ class FileserveCom(Account): def loadAccountInfo(self, user, req): data = self.getAccountData(user) - html = req.load("http://app.fileserve.com/api/login/", post={"username": user, "password": data['password'], - "submit": "Submit+Query"}) + html = self.load("http://app.fileserve.com/api/login/", post={"username": user, "password": data['password'], + "submit": "Submit+Query"}, req=req) res = json_loads(html) if res['type'] == "premium": @@ -31,14 +31,14 @@ class FileserveCom(Account): def login(self, user, data, req): - html = req.load("http://app.fileserve.com/api/login/", post={"username": user, "password": data['password'], - "submit": "Submit+Query"}) + html = self.load("http://app.fileserve.com/api/login/", post={"username": user, "password": data['password'], + "submit": "Submit+Query"}, req=req) res = json_loads(html) if not res['type']: self.wrongPassword() #login at fileserv html - req.load("http://www.fileserve.com/login.php", + self.load("http://www.fileserve.com/login.php", post={"loginUserName": user, "loginUserPassword": data['password'], "autoLogin": "checked", - "loginFormSubmit": "Login"}) + "loginFormSubmit": "Login"}, req=req) diff --git a/module/plugins/accounts/FourSharedCom.py b/module/plugins/accounts/FourSharedCom.py index 054f0d3a1..041671b9a 100644 --- a/module/plugins/accounts/FourSharedCom.py +++ b/module/plugins/accounts/FourSharedCom.py @@ -22,13 +22,12 @@ class FourSharedCom(Account): def login(self, user, data, req): req.cj.setCookie("4shared.com", "4langcookie", "en") - res = req.load("https://www.4shared.com/web/login", + res = self.load("https://www.4shared.com/web/login", post={'login' : user, 'password' : data['password'], 'remember' : "on", '_remember': "on", - 'returnTo' : "http://www.4shared.com/account/home.jsp"}, - decode=True) + 'returnTo' : "http://www.4shared.com/account/home.jsp"}, req=req) if 'Please log in to access your 4shared account' in res: self.wrongPassword() diff --git a/module/plugins/accounts/FreakshareCom.py b/module/plugins/accounts/FreakshareCom.py index 83d26fbe5..b33790071 100644 --- a/module/plugins/accounts/FreakshareCom.py +++ b/module/plugins/accounts/FreakshareCom.py @@ -21,7 +21,7 @@ class FreakshareCom(Account): validuntil = None trafficleft = None - html = req.load("http://freakshare.com/") + html = self.load("http://freakshare.com/", req=req) try: m = re.search(r'ltig bis:</td>\s*<td><b>([\d.:-]+)</b></td>', html, re.M) @@ -41,11 +41,10 @@ class FreakshareCom(Account): def login(self, user, data, req): - req.load("http://freakshare.com/index.php?language=EN") + self.load("http://freakshare.com/index.php?language=EN", req=req) - html = req.load("https://freakshare.com/login.html", - post={"submit": "Login", "user": user, "pass": data['password']}, - decode=True) + html = self.load("https://freakshare.com/login.html", + post={"submit": "Login", "user": user, "pass": data['password']}, req=req) if ">Wrong Username or Password" in html: self.wrongPassword() diff --git a/module/plugins/accounts/FreeWayMe.py b/module/plugins/accounts/FreeWayMe.py index 66f93e0bb..5a1f75bf6 100644 --- a/module/plugins/accounts/FreeWayMe.py +++ b/module/plugins/accounts/FreeWayMe.py @@ -41,7 +41,7 @@ class FreeWayMe(Account): def getAccountStatus(self, user, req): - answer = req.load("http://www.free-way.bz/ajax/jd.php", #@TODO: Revert to `https` in 0.4.10 + 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.getAccountData(user)['password']}) self.logDebug("Login: %s" % answer) diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py index 08d5fe555..67aafae86 100644 --- a/module/plugins/accounts/FshareVn.py +++ b/module/plugins/accounts/FshareVn.py @@ -24,7 +24,7 @@ class FshareVn(Account): def loadAccountInfo(self, user, req): - html = req.load("http://www.fshare.vn/account_info.php", decode=True) + html = self.load("http://www.fshare.vn/account_info.php", req=req) if re.search(self.LIFETIME_PATTERN, html): self.logDebug("Lifetime membership detected") @@ -45,13 +45,12 @@ class FshareVn(Account): def login(self, user, data, req): - html = req.load("https://www.fshare.vn/login.php", + html = self.load("https://www.fshare.vn/login.php", post={'LoginForm[email]' : user, 'LoginForm[password]' : data['password'], 'LoginForm[rememberMe]': 1, 'yt0' : "Login"}, - referer=True, - decode=True) + referer=True, req=req) if not re.search(r'<img\s+alt="VIP"', html): self.wrongPassword() diff --git a/module/plugins/accounts/HellshareCz.py b/module/plugins/accounts/HellshareCz.py index 69b4b8443..a1f50eb8b 100644 --- a/module/plugins/accounts/HellshareCz.py +++ b/module/plugins/accounts/HellshareCz.py @@ -21,7 +21,7 @@ class HellshareCz(Account): def loadAccountInfo(self, user, req): self.relogin(user) - html = req.load("http://www.hellshare.com/") + html = self.load("http://www.hellshare.com/", req=req) m = re.search(self.CREDIT_LEFT_PATTERN, html) if m is None: @@ -52,28 +52,27 @@ class HellshareCz(Account): def login(self, user, data, req): - html = req.load('http://www.hellshare.com/', decode=True) + html = self.load('http://www.hellshare.com/', req=req) if req.lastEffectiveURL != 'http://www.hellshare.com/': #Switch to English self.logDebug("Switch lang - URL: %s" % req.lastEffectiveURL) - json = req.load("%s?do=locRouter-show" % req.lastEffectiveURL) + json = self.load("%s?do=locRouter-show" % req.lastEffectiveURL, req=req) hash = re.search(r"(\-\-[0-9a-f]+\-)", json).group(1) self.logDebug("Switch lang - HASH: %s" % hash) - html = req.load('http://www.hellshare.com/%s/' % hash, decode=True) + html = self.load('http://www.hellshare.com/%s/' % hash, req=req) if re.search(self.CREDIT_LEFT_PATTERN, html): self.logDebug("Already logged in") return - html = req.load('https://www.hellshare.com/login?do=loginForm-submit', + html = self.load('https://www.hellshare.com/login?do=loginForm-submit', post={"login": "Log in", "password": data['password'], "username": user, - "perm_login": "on"}, - decode=True) + "perm_login": "on"}, req=req) if "<p>You input a wrong user name or wrong password</p>" in html: self.wrongPassword() diff --git a/module/plugins/accounts/HighWayMe.py b/module/plugins/accounts/HighWayMe.py index eba1b4692..d85db9769 100644 --- a/module/plugins/accounts/HighWayMe.py +++ b/module/plugins/accounts/HighWayMe.py @@ -19,7 +19,7 @@ class HighWayMe(Account): validuntil = -1 trafficleft = None - json_data = req.load('https://high-way.me/api.php?user') + json_data = self.load('https://high-way.me/api.php?user', req=req) self.logDebug("JSON data: %s" % json_data) @@ -40,9 +40,8 @@ class HighWayMe(Account): def login(self, user, data, req): - html = req.load("https://high-way.me/api.php?login", - post={'login': '1', 'user': user, 'pass': data['password']}, - decode=True) + html = self.load("https://high-way.me/api.php?login", + post={'login': '1', 'user': user, 'pass': data['password']}, req=req) if 'UserOrPassInvalid' in html: self.wrongPassword() diff --git a/module/plugins/accounts/Keep2ShareCc.py b/module/plugins/accounts/Keep2ShareCc.py index 8cd23aed6..617e18f25 100644 --- a/module/plugins/accounts/Keep2ShareCc.py +++ b/module/plugins/accounts/Keep2ShareCc.py @@ -28,7 +28,7 @@ class Keep2ShareCc(Account): trafficleft = -1 premium = False - html = req.load("http://keep2share.cc/site/profile.html", decode=True) + html = self.load("http://keep2share.cc/site/profile.html", req=req) m = re.search(self.VALID_UNTIL_PATTERN, html) if m: @@ -62,12 +62,11 @@ class Keep2ShareCc(Account): def login(self, user, data, req): req.cj.setCookie("keep2share.cc", "lang", "en") - html = req.load("https://keep2share.cc/login.html", + html = self.load("https://keep2share.cc/login.html", post={'LoginForm[username]' : user, 'LoginForm[password]' : data['password'], 'LoginForm[rememberMe]': 1, - 'yt0' : ""}, - decode=True) + 'yt0' : ""}, req=req) if re.search(self.LOGIN_FAIL_PATTERN, html): self.wrongPassword() diff --git a/module/plugins/accounts/LetitbitNet.py b/module/plugins/accounts/LetitbitNet.py index e5c61e35f..6b538c1f0 100644 --- a/module/plugins/accounts/LetitbitNet.py +++ b/module/plugins/accounts/LetitbitNet.py @@ -18,7 +18,7 @@ class LetitbitNet(Account): ## DISABLED BECAUSE IT GET 'key exausted' EVEN IF VALID ## # api_key = self.getAccountData(user)['password'] # json_data = [api_key, ['key/info']] - # api_rep = req.load('http://api.letitbit.net/json', post={'r': json_dumps(json_data)}) + # api_rep = self.load('http://api.letitbit.net/json', post={'r': json_dumps(json_data)}, req=req) # self.logDebug("API Key Info: " + api_rep) # api_rep = json_loads(api_rep) # diff --git a/module/plugins/accounts/LinksnappyCom.py b/module/plugins/accounts/LinksnappyCom.py index 2b1d1aebf..4a475bd24 100644 --- a/module/plugins/accounts/LinksnappyCom.py +++ b/module/plugins/accounts/LinksnappyCom.py @@ -18,8 +18,8 @@ class LinksnappyCom(Account): def loadAccountInfo(self, user, req): data = self.getAccountData(user) - r = req.load('http://gen.linksnappy.com/lseAPI.php', - get={'act': 'USERDETAILS', 'username': user, 'password': hashlib.md5(data['password']).hexdigest()}) + r = self.load('http://gen.linksnappy.com/lseAPI.php', + get={'act': 'USERDETAILS', 'username': user, 'password': hashlib.md5(data['password'], req=req).hexdigest()}) self.logDebug("JSON data: " + r) @@ -50,11 +50,10 @@ class LinksnappyCom(Account): def login(self, user, data, req): - html = req.load("https://gen.linksnappy.com/lseAPI.php", + html = self.load("https://gen.linksnappy.com/lseAPI.php", get={'act' : 'USERDETAILS', 'username': user, - 'password': hashlib.md5(data['password']).hexdigest()}, - decode=True) + 'password': hashlib.md5(data['password'], req=req).hexdigest()}) if "Invalid Account Details" in html: self.wrongPassword() diff --git a/module/plugins/accounts/MegaDebridEu.py b/module/plugins/accounts/MegaDebridEu.py index fc7a5e5a3..4767b9b05 100644 --- a/module/plugins/accounts/MegaDebridEu.py +++ b/module/plugins/accounts/MegaDebridEu.py @@ -20,8 +20,8 @@ class MegaDebridEu(Account): def loadAccountInfo(self, user, req): data = self.getAccountData(user) - jsonResponse = req.load(self.API_URL, - get={'action': 'connectUser', 'login': user, 'password': data['password']}) + jsonResponse = self.load(self.API_URL, + get={'action': 'connectUser', 'login': user, 'password': data['password']}, req=req) res = json_loads(jsonResponse) if res['response_code'] == "ok": @@ -32,8 +32,8 @@ class MegaDebridEu(Account): def login(self, user, data, req): - jsonResponse = req.load(self.API_URL, - get={'action': 'connectUser', 'login': user, 'password': data['password']}) + jsonResponse = self.load(self.API_URL, + get={'action': 'connectUser', 'login': user, 'password': data['password']}, req=req) 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 ffb0024ca..af23b7bf3 100644 --- a/module/plugins/accounts/MegaRapidCz.py +++ b/module/plugins/accounts/MegaRapidCz.py @@ -25,7 +25,7 @@ class MegaRapidCz(Account): def loadAccountInfo(self, user, req): - htmll = req.load("http://megarapid.cz/mujucet/", decode=True) + htmll = self.load("http://megarapid.cz/mujucet/", req=req) m = re.search(self.LIMITDL_PATTERN, htmll) if m: @@ -46,15 +46,15 @@ class MegaRapidCz(Account): def login(self, user, data, req): - html = req.load("http://megarapid.cz/prihlaseni/", decode=True) + html = self.load("http://megarapid.cz/prihlaseni/", req=req) if "Heslo:" in html: start = html.index('id="inp_hash" name="hash" value="') html = html[start + 33:] hashes = html[0:32] - html = req.load("https://megarapid.cz/prihlaseni/", + html = self.load("https://megarapid.cz/prihlaseni/", post={"hash": hashes, "login": user, "pass1": data['password'], "remember": 0, - "sbmt": u"Přihlásit"}) + "sbmt": u"Přihlásit"}, req=req) diff --git a/module/plugins/accounts/MegaRapidoNet.py b/module/plugins/accounts/MegaRapidoNet.py index 93afd3578..de1c775c7 100644 --- a/module/plugins/accounts/MegaRapidoNet.py +++ b/module/plugins/accounts/MegaRapidoNet.py @@ -25,7 +25,7 @@ class MegaRapidoNet(Account): trafficleft = None premium = False - html = req.load("http://megarapido.net/gerador", decode=True) + html = self.load("http://megarapido.net/gerador", req=req) validuntil = re.search(self.VALID_UNTIL_PATTERN, html) if validuntil: @@ -40,12 +40,11 @@ class MegaRapidoNet(Account): def login(self, user, data, req): - req.load("http://megarapido.net/login") - req.load("http://megarapido.net/painel_user/ajax/logar.php", - post={'login': user, 'senha': data['password']}, - decode=True) + self.load("http://megarapido.net/login", req=req) + self.load("http://megarapido.net/painel_user/ajax/logar.php", + post={'login': user, 'senha': data['password']}, req=req) - html = req.load("http://megarapido.net/gerador") + html = self.load("http://megarapido.net/gerador", req=req) if "sair" not in html.lower(): self.wrongPassword() diff --git a/module/plugins/accounts/MegasharesCom.py b/module/plugins/accounts/MegasharesCom.py index d9ef7abb9..af0987ed3 100644 --- a/module/plugins/accounts/MegasharesCom.py +++ b/module/plugins/accounts/MegasharesCom.py @@ -21,7 +21,7 @@ class MegasharesCom(Account): def loadAccountInfo(self, user, req): #self.relogin(user) - html = req.load("http://d01.megashares.com/myms.php", decode=True) + html = self.load("http://d01.megashares.com/myms.php", req=req) premium = False if '>Premium Upgrade<' in html else True @@ -37,12 +37,11 @@ class MegasharesCom(Account): def login(self, user, data, req): - html = req.load('http://d01.megashares.com/myms_login.php', + html = self.load('http://d01.megashares.com/myms_login.php', post={"httpref" : "", "myms_login" : "Login", "mymslogin_name": user, - "mymspassword" : data['password']}, - decode=True) + "mymspassword" : data['password']}, req=req) if not '<span class="b ml">%s</span>' % user in html: self.wrongPassword() diff --git a/module/plugins/accounts/MultishareCz.py b/module/plugins/accounts/MultishareCz.py index df498e6a6..be947f7f2 100644 --- a/module/plugins/accounts/MultishareCz.py +++ b/module/plugins/accounts/MultishareCz.py @@ -21,24 +21,23 @@ class MultishareCz(Account): def loadAccountInfo(self, user, req): #self.relogin(user) - html = req.load("http://www.multishare.cz/profil/", decode=True) + html = self.load("http://www.multishare.cz/profil/", req=req) m = re.search(self.TRAFFIC_LEFT_PATTERN, html) trafficleft = self.parseTraffic(m.group('S') + m.group('U')) if m else 0 self.premium = True if trafficleft else False - html = req.load("http://www.multishare.cz/", decode=True) + html = self.load("http://www.multishare.cz/", req=req) mms_info = dict(re.findall(self.ACCOUNT_INFO_PATTERN, html)) return dict(mms_info, **{"validuntil": -1, "trafficleft": trafficleft}) def login(self, user, data, req): - html = req.load('https://www.multishare.cz/html/prihlaseni_process.php', + html = self.load('https://www.multishare.cz/html/prihlaseni_process.php', post={"akce" : "Přihlásit", "heslo": data['password'], - "jmeno": user}, - decode=True) + "jmeno": user}, req=req) if '<div class="akce-chyba akce">' in html: self.wrongPassword() diff --git a/module/plugins/accounts/MyfastfileCom.py b/module/plugins/accounts/MyfastfileCom.py index 00de6d959..a854dd826 100644 --- a/module/plugins/accounts/MyfastfileCom.py +++ b/module/plugins/accounts/MyfastfileCom.py @@ -26,8 +26,8 @@ class MyfastfileCom(Account): def login(self, user, data, req): # Password to use is the API-Password written in http://myfastfile.com/myaccount - html = req.load("https://myfastfile.com/api.php", - get={"user": user, "pass": data['password']}) + html = self.load("https://myfastfile.com/api.php", + get={"user": user, "pass": data['password']}, req=req) self.logDebug("JSON data: " + html) diff --git a/module/plugins/accounts/NitroflareCom.py b/module/plugins/accounts/NitroflareCom.py index 0397b113d..cc2f4e232 100644 --- a/module/plugins/accounts/NitroflareCom.py +++ b/module/plugins/accounts/NitroflareCom.py @@ -28,9 +28,8 @@ class NitroflareCom(Account): trafficleft = None premium = False - html = req.load("https://nitroflare.com/member", - get={'s': "premium"}, - decode=True) + html = self.load("https://nitroflare.com/member", + get={'s': "premium"}, req=req) m = re.search(self.VALID_UNTIL_PATTERN, html) if m: @@ -68,16 +67,15 @@ class NitroflareCom(Account): def login(self, user, data, req): - html = req.load("https://nitroflare.com/login", decode=True) + html = self.load("https://nitroflare.com/login", req=req) token = re.search(self.TOKEN_PATTERN, html).group(1) - html = req.load("https://nitroflare.com/login", + html = self.load("https://nitroflare.com/login", post={'login' : "", 'email' : user, 'password': data['password'], - 'token' : token}, - decode=True) + 'token' : token}, req=req) if re.search(self.LOGIN_FAIL_PATTERN, html): self.wrongPassword() diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index 4944ad4df..024cdfebe 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -78,4 +78,4 @@ class NoPremiumPl(Account): def runAuthQuery(self): - return self._req.load(self.API_URL, post=self.createAuthQuery()) + return self._self.load(self.API_URL, post=self.createAuthQuery(), req=req) diff --git a/module/plugins/accounts/NowVideoSx.py b/module/plugins/accounts/NowVideoSx.py index a0cc90790..81267d413 100644 --- a/module/plugins/accounts/NowVideoSx.py +++ b/module/plugins/accounts/NowVideoSx.py @@ -24,7 +24,7 @@ class NowVideoSx(Account): trafficleft = -1 premium = None - html = req.load("http://www.nowvideo.sx/premium.php") + html = self.load("http://www.nowvideo.sx/premium.php", req=req) m = re.search(self.VALID_UNTIL_PATTERN, html) if m: @@ -48,9 +48,8 @@ class NowVideoSx(Account): def login(self, user, data, req): - html = req.load("http://www.nowvideo.sx/login.php", - post={'user': user, 'pass': data['password']}, - decode=True) + html = self.load("http://www.nowvideo.sx/login.php", + post={'user': user, 'pass': data['password']}, req=req) if re.search(r'>Log In<', html): self.wrongPassword() diff --git a/module/plugins/accounts/OboomCom.py b/module/plugins/accounts/OboomCom.py index b1217cff5..96ef51f1e 100644 --- a/module/plugins/accounts/OboomCom.py +++ b/module/plugins/accounts/OboomCom.py @@ -35,7 +35,7 @@ class OboomCom(Account): salt = passwd[::-1] pbkdf2 = PBKDF2(passwd, salt, 1000).hexread(16) - result = json_loads(req.load("https://www.oboom.com/1/login", get={"auth": user, "pass": pbkdf2})) + result = json_loads(self.load("https://www.oboom.com/1/login", get={"auth": user, "pass": pbkdf2}), req=req) if not result[0] == 200: self.logWarning(_("Failed to log in: %s") % result[1]) diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py index a9c6829b1..3a345bd9f 100644 --- a/module/plugins/accounts/OneFichierCom.py +++ b/module/plugins/accounts/OneFichierCom.py @@ -26,7 +26,7 @@ class OneFichierCom(Account): trafficleft = -1 premium = None - html = req.load("https://1fichier.com/console/abo.pl") + html = self.load("https://1fichier.com/console/abo.pl", req=req) m = re.search(self.VALID_UNTIL_PATTERN, html) if m: @@ -46,13 +46,12 @@ class OneFichierCom(Account): def login(self, user, data, req): req.http.c.setopt(pycurl.REFERER, "https://1fichier.com/login.pl?lg=en") - html = req.load("https://1fichier.com/login.pl?lg=en", + html = self.load("https://1fichier.com/login.pl?lg=en", post={'mail' : user, 'pass' : data['password'], 'It' : "on", 'purge' : "off", - 'valider': "Send"}, - decode=True) + 'valider': "Send"}, req=req) if '>Invalid email address' in html or '>Invalid password' in html: self.wrongPassword() diff --git a/module/plugins/accounts/OverLoadMe.py b/module/plugins/accounts/OverLoadMe.py index 82f4d9240..e7e1b71e1 100644 --- a/module/plugins/accounts/OverLoadMe.py +++ b/module/plugins/accounts/OverLoadMe.py @@ -16,9 +16,9 @@ class OverLoadMe(Account): def loadAccountInfo(self, user, req): data = self.getAccountData(user) - html = req.load("https://api.over-load.me/account.php", + html = self.load("https://api.over-load.me/account.php", get={'user': user, - 'auth': data['password']}).strip() + 'auth': data['password']}, req=req).strip() data = json_loads(html) self.logDebug(data) @@ -31,9 +31,9 @@ class OverLoadMe(Account): def login(self, user, data, req): - jsondata = req.load("https://api.over-load.me/account.php", + jsondata = self.load("https://api.over-load.me/account.php", get={'user': user, - 'auth': data['password']}).strip() + 'auth': data['password']}, req=req).strip() data = json_loads(jsondata) diff --git a/module/plugins/accounts/PremiumTo.py b/module/plugins/accounts/PremiumTo.py index 322225d36..fb99cfd59 100644 --- a/module/plugins/accounts/PremiumTo.py +++ b/module/plugins/accounts/PremiumTo.py @@ -16,8 +16,8 @@ class PremiumTo(Account): def loadAccountInfo(self, user, req): - traffic = req.load("http://premium.to/api/straffic.php", #@TODO: Revert to `https` in 0.4.10 - get={'username': self.username, 'password': self.password}) + traffic = self.load("http://premium.to/api/straffic.php", #@TODO: Revert to `https` in 0.4.10 + get={'username': self.username, 'password': self.password}, req=req) if "wrong username" not in traffic: trafficleft = sum(map(float, traffic.split(';'))) / 1024 #@TODO: Remove `/ 1024` in 0.4.10 @@ -29,9 +29,8 @@ class PremiumTo(Account): def login(self, user, data, req): self.username = user self.password = data['password'] - authcode = req.load("http://premium.to/api/getauthcode.php", #@TODO: Revert to `https` in 0.4.10 - get={'username': user, 'password': self.password}, - decode=True) + authcode = self.load("http://premium.to/api/getauthcode.php", #@TODO: Revert to `https` in 0.4.10 + get={'username': user, 'password': self.password}, req=req) if "wrong username" in authcode: self.wrongPassword() diff --git a/module/plugins/accounts/PremiumizeMe.py b/module/plugins/accounts/PremiumizeMe.py index 17470b4a2..686898ca4 100644 --- a/module/plugins/accounts/PremiumizeMe.py +++ b/module/plugins/accounts/PremiumizeMe.py @@ -41,7 +41,7 @@ class PremiumizeMe(Account): def getAccountStatus(self, user, req): # Use premiumize.me API v1 (see https://secure.premiumize.me/?show=api) # to retrieve account info and return the parsed json answer - answer = req.load("http://api.premiumize.me/pm-api/v1.php", #@TODO: Revert to `https` in 0.4.10 + 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.getAccountData(user)['password']}) diff --git a/module/plugins/accounts/QuickshareCz.py b/module/plugins/accounts/QuickshareCz.py index 0e52d5f79..c3cfe6f6f 100644 --- a/module/plugins/accounts/QuickshareCz.py +++ b/module/plugins/accounts/QuickshareCz.py @@ -19,7 +19,7 @@ class QuickshareCz(Account): def loadAccountInfo(self, user, req): - html = req.load("http://www.quickshare.cz/premium", decode=True) + html = self.load("http://www.quickshare.cz/premium", req=req) m = re.search(self.TRAFFIC_LEFT_PATTERN, html) if m: @@ -33,11 +33,10 @@ class QuickshareCz(Account): def login(self, user, data, req): - html = req.load('http://www.quickshare.cz/html/prihlaseni_process.php', + html = self.load('http://www.quickshare.cz/html/prihlaseni_process.php', post={"akce": u'Přihlásit', "heslo": data['password'], - "jmeno": user}, - decode=True) + "jmeno": user}, req=req) if u'>Takový uživatel neexistuje.<' in html or u'>Špatné heslo.<' in html: self.wrongPassword() diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py index b188a34d9..509febde6 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -43,7 +43,7 @@ class RPNetBiz(Account): def getAccountStatus(self, user, req): # Using the rpnet API, check if valid premium account - res = req.load("https://premium.rpnet.biz/client_api.php", + res = self.load("https://premium.rpnet.biz/client_api.php", get={"username": user, "password": self.getAccountData(user)['password'], "action": "showAccountInformation"}) self.logDebug("JSON data: %s" % res) diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index 5039d1494..8b868ee07 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -78,4 +78,4 @@ class RapideoPl(Account): def runAuthQuery(self): - return self._req.load(self.API_URL, post=self.createAuthQuery()) + return self._self.load(self.API_URL, post=self.createAuthQuery(), req=req) diff --git a/module/plugins/accounts/RapidgatorNet.py b/module/plugins/accounts/RapidgatorNet.py index 94692da76..c14490dd5 100644 --- a/module/plugins/accounts/RapidgatorNet.py +++ b/module/plugins/accounts/RapidgatorNet.py @@ -27,7 +27,7 @@ class RapidgatorNet(Account): sid = self.getAccountData(user).get('sid', None) assert sid - html = req.load("%s/info" % self.API_URL, get={'sid': sid}) + html = self.load("%s/info" % self.API_URL, get={'sid': sid}, req=req) self.logDebug("API:USERINFO", html) @@ -54,7 +54,7 @@ class RapidgatorNet(Account): def login(self, user, data, req): try: - html = req.load('%s/login' % self.API_URL, post={"username": user, "password": data['password']}) + html = self.load('%s/login' % self.API_URL, post={"username": user, "password": data['password']}, req=req) self.logDebug("API:LOGIN", html) diff --git a/module/plugins/accounts/RapiduNet.py b/module/plugins/accounts/RapiduNet.py index a158e9ce2..5e74e18bb 100644 --- a/module/plugins/accounts/RapiduNet.py +++ b/module/plugins/accounts/RapiduNet.py @@ -30,7 +30,7 @@ class RapiduNet(Account): trafficleft = -1 premium = False - html = req.load("https://rapidu.net/", decode=True) + html = self.load("https://rapidu.net/", req=req) if re.search(self.PREMIUM_PATTERN, html): premium = True @@ -47,17 +47,17 @@ class RapiduNet(Account): def login(self, user, data, req): - req.load("https://rapidu.net/ajax.php", + self.load("https://rapidu.net/ajax.php", get={'a': "getChangeLang"}, post={'_go' : "", - 'lang': "en"}) + 'lang': "en"}, req=req) - json = json_loads(req.load("https://rapidu.net/ajax.php", + json = json_loads(self.load("https://rapidu.net/ajax.php", get={'a': "getUserLogin"}, post={'_go' : "", 'login' : user, 'pass' : data['password'], - 'remember': "1"})) + 'remember': "1"}, req=req)) self.logDebug(json) diff --git a/module/plugins/accounts/RealdebridCom.py b/module/plugins/accounts/RealdebridCom.py index b29ad33d3..83fdc5dbc 100644 --- a/module/plugins/accounts/RealdebridCom.py +++ b/module/plugins/accounts/RealdebridCom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -import xml.dom.minidom +import xml.dom.minidom as dom from module.plugins.internal.Account import Account @@ -19,10 +19,10 @@ class RealdebridCom(Account): if self.pin_code: return - html = req.load("https://real-debrid.com/api/account.php") - account = xml.dom.minidom.parseString(html) + html = self.load("https://real-debrid.com/api/account.php", req=req) + xml = dom.parseString(html) - validuntil = float(account.getElementsByTagName("expiration")[0].childNodes[0].nodeValue) + validuntil = float(xml.getElementsByTagName("expiration")[0].childNodes[0].nodeValue) return {'validuntil' : validuntil, 'trafficleft': -1 , @@ -32,9 +32,8 @@ class RealdebridCom(Account): def login(self, user, data, req): self.pin_code = False - html = req.load("https://real-debrid.com/ajax/login.php", - get={"user": user, "pass": data['password']}, - decode=True) + html = self.load("https://real-debrid.com/ajax/login.php", + get={"user": user, "pass": data['password']}, req=req) if "Your login informations are incorrect" in html: self.wrongPassword() diff --git a/module/plugins/accounts/RehostTo.py b/module/plugins/accounts/RehostTo.py index 728b2e84e..5f0c1253e 100644 --- a/module/plugins/accounts/RehostTo.py +++ b/module/plugins/accounts/RehostTo.py @@ -19,14 +19,14 @@ class RehostTo(Account): validuntil = -1 session = "" - html = req.load("https://rehost.to/api.php", + html = self.load("https://rehost.to/api.php", get={'cmd' : "login", 'user': user, 'pass': self.getAccountData(user)['password']}) try: session = html.split(",")[1].split("=")[1] - html = req.load("http://rehost.to/api.php", - get={'cmd': "get_premium_credits", 'long_ses': session}) + html = self.load("http://rehost.to/api.php", + get={'cmd': "get_premium_credits", 'long_ses': session}, req=req) if html.strip() == "0,0" or "ERROR" in html: self.logDebug(html) @@ -45,9 +45,8 @@ class RehostTo(Account): def login(self, user, data, req): - html = req.load("https://rehost.to/api.php", - get={'cmd': "login", 'user': user, 'pass': data['password']}, - decode=True) + html = self.load("https://rehost.to/api.php", + get={'cmd': "login", 'user': user, 'pass': data['password']}, req=req) if "ERROR" in html: self.logDebug(html) diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 9269cf2a1..5a3359496 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -16,7 +16,7 @@ class ShareonlineBiz(Account): def api_response(self, user, req): - return req.load("http://api.share-online.biz/cgi-bin", + return self.load("http://api.share-online.biz/cgi-bin", get={'q' : "userdetails", 'aux' : "traffic", 'username': user, diff --git a/module/plugins/accounts/SimplyPremiumCom.py b/module/plugins/accounts/SimplyPremiumCom.py index 5c87cbbfb..053f2c33b 100644 --- a/module/plugins/accounts/SimplyPremiumCom.py +++ b/module/plugins/accounts/SimplyPremiumCom.py @@ -19,7 +19,7 @@ class SimplyPremiumCom(Account): validuntil = -1 trafficleft = None - json_data = req.load('http://www.simply-premium.com/api/user.php?format=json') + json_data = self.load('http://www.simply-premium.com/api/user.php?format=json', req=req) self.logDebug("JSON data: %s" % json_data) @@ -40,9 +40,8 @@ class SimplyPremiumCom(Account): def login(self, user, data, req): req.cj.setCookie("simply-premium.com", "lang", "EN") - html = req.load("https://www.simply-premium.com/login.php", - post={'key': user} if not data['password'] else {'login_name': user, 'login_pass': data['password']}, - decode=True) + 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']}, req=req) if 'logout' not in html: self.wrongPassword() diff --git a/module/plugins/accounts/SimplydebridCom.py b/module/plugins/accounts/SimplydebridCom.py index 97b2b8ecd..e9fda682b 100644 --- a/module/plugins/accounts/SimplydebridCom.py +++ b/module/plugins/accounts/SimplydebridCom.py @@ -17,7 +17,7 @@ class SimplydebridCom(Account): def loadAccountInfo(self, user, req): get_data = {'login': 2, 'u': self.loginname, 'p': self.password} - res = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True) + res = self.load("http://simply-debrid.com/api.php", get=get_data, req=req) data = [x.strip() for x in res.split(";")] if str(data[0]) != "1": return {"premium": False} @@ -30,6 +30,6 @@ class SimplydebridCom(Account): self.password = data['password'] get_data = {'login': 1, 'u': self.loginname, 'p': self.password} - res = req.load("https://simply-debrid.com/api.php", get=get_data, decode=True) + res = self.load("https://simply-debrid.com/api.php", get=get_data, req=req) if res != "02: loggin success": self.wrongPassword() diff --git a/module/plugins/accounts/SmoozedCom.py b/module/plugins/accounts/SmoozedCom.py index b51e5cef3..da81a6b80 100644 --- a/module/plugins/accounts/SmoozedCom.py +++ b/module/plugins/accounts/SmoozedCom.py @@ -74,5 +74,5 @@ class SmoozedCom(Account): salt = hashlib.sha256(password).hexdigest() encrypted = PBKDF2(password, salt, iterations=1000).hexread(32) - return json_loads(req.load("http://www2.smoozed.com/api/login", - get={'auth': user, 'password': encrypted})) + return json_loads(self.load("http://www2.smoozed.com/api/login", + get={'auth': user, 'password': encrypted}, req=req)) diff --git a/module/plugins/accounts/TurbobitNet.py b/module/plugins/accounts/TurbobitNet.py index 43aaf6aa3..7e3bd628f 100644 --- a/module/plugins/accounts/TurbobitNet.py +++ b/module/plugins/accounts/TurbobitNet.py @@ -17,7 +17,7 @@ class TurbobitNet(Account): def loadAccountInfo(self, user, req): - html = req.load("http://turbobit.net") + html = self.load("http://turbobit.net", req=req) m = re.search(r'<u>Turbo Access</u> to ([\d.]+)', html) if m: @@ -33,11 +33,10 @@ class TurbobitNet(Account): def login(self, user, data, req): req.cj.setCookie("turbobit.net", "user_lang", "en") - html = req.load("http://turbobit.net/user/login", + html = self.load("http://turbobit.net/user/login", post={"user[login]": user, "user[pass]": data['password'], - "user[submit]": "Login"}, - decode=True) + "user[submit]": "Login"}, req=req) if not '<div class="menu-item user-name">' in html: self.wrongPassword() diff --git a/module/plugins/accounts/UlozTo.py b/module/plugins/accounts/UlozTo.py index b4f393bfc..3763e2a16 100644 --- a/module/plugins/accounts/UlozTo.py +++ b/module/plugins/accounts/UlozTo.py @@ -21,7 +21,7 @@ class UlozTo(Account): def loadAccountInfo(self, user, req): - html = req.load("http://www.ulozto.net/", decode=True) + html = self.load("http://www.ulozto.net/", req=req) m = re.search(self.TRAFFIC_LEFT_PATTERN, html) @@ -32,18 +32,17 @@ class UlozTo(Account): def login(self, user, data, req): - login_page = req.load('http://www.ulozto.net/?do=web-login', decode=True) + login_page = self.load('http://www.ulozto.net/?do=web-login', req=req) action = re.findall('<form action="(.+?)"', login_page)[1].replace('&', '&') token = re.search('_token_" value="(.+?)"', login_page).group(1) - html = req.load(urlparse.urljoin("https://www.ulozto.net/", action), + html = self.load(urlparse.urljoin("https://www.ulozto.net/", action, req=req), post={'_token_' : token, 'do' : "loginForm-submit", 'login' : u"Přihlásit", 'password': data['password'], 'username': user, - 'remember': "on"}, - decode=True) + 'remember': "on"}) if '<div class="flash error">' in html: self.wrongPassword() diff --git a/module/plugins/accounts/UploadableCh.py b/module/plugins/accounts/UploadableCh.py index 9543feb6d..b0def5600 100644 --- a/module/plugins/accounts/UploadableCh.py +++ b/module/plugins/accounts/UploadableCh.py @@ -14,7 +14,7 @@ class UploadableCh(Account): def loadAccountInfo(self, user, req): - html = req.load("http://www.uploadable.ch/login.php") + html = self.load("http://www.uploadable.ch/login.php", req=req) premium = '<a href="/logout.php"' in html trafficleft = -1 if premium else None @@ -23,12 +23,11 @@ class UploadableCh(Account): def login(self, user, data, req): - html = req.load("http://www.uploadable.ch/login.php", + html = self.load("http://www.uploadable.ch/login.php", post={'userName' : user, 'userPassword' : data["password"], 'autoLogin' : "1", - 'action__login': "normalLogin"}, - decode=True) + 'action__login': "normalLogin"}, req=req) if "Login failed" in html: self.wrongPassword() diff --git a/module/plugins/accounts/UploadedTo.py b/module/plugins/accounts/UploadedTo.py index dc4c9fb73..8cdfab0c6 100644 --- a/module/plugins/accounts/UploadedTo.py +++ b/module/plugins/accounts/UploadedTo.py @@ -26,7 +26,7 @@ class UploadedTo(Account): trafficleft = None premium = None - html = req.load("http://uploaded.net/me") + html = self.load("http://uploaded.net/me", req=req) premium = True if re.search(self.PREMIUM_PATTERN, html) else False @@ -63,9 +63,8 @@ class UploadedTo(Account): def login(self, user, data, req): # req.cj.setCookie("uploaded.net", "lang", "en") - html = req.load("https://uploaded.net/io/login", - post={'id': user, 'pw': data['password'], '_': ""}, - decode=True) + html = self.load("https://uploaded.net/io/login", + post={'id': user, 'pw': data['password'], '_': ""}, req=req) if '"err"' in html: self.wrongPassword() diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py index f8f2fbc1d..598b7ac57 100644 --- a/module/plugins/accounts/UploadheroCom.py +++ b/module/plugins/accounts/UploadheroCom.py @@ -21,7 +21,7 @@ class UploadheroCom(Account): premium_pattern = re.compile('Il vous reste <span class="bleu">(\d+)</span> jours premium') data = self.getAccountData(user) - html = req.load("http://uploadhero.co/my-account") + html = self.load("http://uploadhero.co/my-account", req=req) if premium_pattern.search(html): end_date = datetime.date.today() + datetime.timedelta(days=int(premium_pattern.search(html).group(1))) @@ -34,9 +34,8 @@ class UploadheroCom(Account): def login(self, user, data, req): - html = req.load("http://uploadhero.co/lib/connexion.php", - post={"pseudo_login": user, "password_login": data['password']}, - decode=True) + html = self.load("http://uploadhero.co/lib/connexion.php", + post={"pseudo_login": user, "password_login": data['password']}, req=req) if "mot de passe invalide" in html: self.wrongPassword() diff --git a/module/plugins/accounts/UploadingCom.py b/module/plugins/accounts/UploadingCom.py index 967f79678..c701fb8fa 100644 --- a/module/plugins/accounts/UploadingCom.py +++ b/module/plugins/accounts/UploadingCom.py @@ -4,7 +4,7 @@ import re import time from module.plugins.internal.Account import Account -from module.plugins.internal.SimpleHoster import set_cookies +from module.plugins.internal.Plugin import set_cookies class UploadingCom(Account): @@ -26,7 +26,7 @@ class UploadingCom(Account): trafficleft = None premium = None - html = req.load("http://uploading.com/") + html = self.load("http://uploading.com/", req=req) premium = False if re.search(self.PREMIUM_PATTERN, html) else True @@ -60,6 +60,6 @@ class UploadingCom(Account): ("uploading.com", "setlang" , "en"), ("uploading.com", "_lang" , "en")]) - req.load("http://uploading.com/") - req.load("https://uploading.com/general/login_form/?JsHttpRequest=%s-xml" % long(time.time() * 1000), + self.load("http://uploading.com/", req=req) + self.load("https://uploading.com/general/login_form/?JsHttpRequest=%s-xml" % long(time.time() * 1000, req=req), post={'email': user, 'password': data['password'], 'remember': "on"}) diff --git a/module/plugins/accounts/WebshareCz.py b/module/plugins/accounts/WebshareCz.py index c88e86aba..d0f5524a2 100644 --- a/module/plugins/accounts/WebshareCz.py +++ b/module/plugins/accounts/WebshareCz.py @@ -25,9 +25,8 @@ class WebshareCz(Account): def loadAccountInfo(self, user, req): - html = req.load("https://webshare.cz/api/user_data/", - post={'wst': self.getAccountData(user).get('wst', None)}, - decode=True) + html = self.load("https://webshare.cz/api/user_data/", + post={'wst': self.getAccountData(user).get('wst', None)}) self.logDebug("Response: " + html) @@ -42,10 +41,9 @@ class WebshareCz(Account): def login(self, user, data, req): - salt = req.load("https://webshare.cz/api/salt/", + salt = self.load("https://webshare.cz/api/salt/", post={'username_or_email': user, - 'wst' : ""}, - decode=True) + 'wst' : ""}, req=req) if "<status>OK</status>" not in salt: self.wrongPassword() @@ -54,13 +52,12 @@ class WebshareCz(Account): password = hashlib.sha1(md5_crypt.encrypt(data["password"], salt=salt)).hexdigest() digest = hashlib.md5(user + ":Webshare:" + password).hexdigest() - login = req.load("https://webshare.cz/api/login/", + login = self.load("https://webshare.cz/api/login/", post={'digest' : digest, 'keep_logged_in' : 1, 'password' : password, 'username_or_email': user, - 'wst' : ""}, - decode=True) + 'wst' : ""}, req=req) if "<status>OK</status>" not in login: self.wrongPassword() diff --git a/module/plugins/accounts/YibaishiwuCom.py b/module/plugins/accounts/YibaishiwuCom.py index 2f1c990ec..9d1d1d38f 100644 --- a/module/plugins/accounts/YibaishiwuCom.py +++ b/module/plugins/accounts/YibaishiwuCom.py @@ -20,7 +20,7 @@ class YibaishiwuCom(Account): def loadAccountInfo(self, user, req): #self.relogin(user) - html = req.load("http://115.com/", decode=True) + html = self.load("http://115.com/", req=req) m = re.search(self.ACCOUNT_INFO_PATTERN, html, re.S) premium = True if m and 'is_vip: 1' in m.group(1) else False @@ -29,12 +29,11 @@ class YibaishiwuCom(Account): def login(self, user, data, req): - html = req.load("https://passport.115.com/?ac=login", + 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']}, - decode=True) + "login[passwd]": data['password']}, req=req) if not 'var USER_PERMISSION = {' in html: self.wrongPassword() diff --git a/module/plugins/accounts/ZeveraCom.py b/module/plugins/accounts/ZeveraCom.py index 220a6600e..0ca7fba45 100644 --- a/module/plugins/accounts/ZeveraCom.py +++ b/module/plugins/accounts/ZeveraCom.py @@ -62,10 +62,9 @@ class ZeveraCom(Account): get_data.update(kwargs) - res = req.load(self.API_URL, + res = self.load(self.API_URL, get=get_data, - just_header=just_header, - decode=True) + just_header=just_header, req=req) self.logDebug(res) |