diff options
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r-- | module/plugins/accounts/AlldebridCom.py | 4 | ||||
-rw-r--r-- | module/plugins/accounts/FastixRu.py | 11 | ||||
-rwxr-xr-x | module/plugins/accounts/NetloadIn.py | 2 | ||||
-rw-r--r-- | module/plugins/accounts/PremiumTo.py | 4 | ||||
-rw-r--r-- | module/plugins/accounts/PremiumizeMe.py | 7 | ||||
-rw-r--r-- | module/plugins/accounts/RehostTo.py | 9 |
6 files changed, 21 insertions, 16 deletions
diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index 344b54e4f..1fb5e4b54 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -36,8 +36,8 @@ class AlldebridCom(Account): #Get expiration date from API except: data = self.getAccountData(user) - page = req.load("http://www.alldebrid.com/api.php?action=info_user&login=%s&pw=%s" % (user, - data['password'])) + page = req.load("http://www.alldebrid.com/api.php", + get={'action': "info_user", 'login': user, 'pw': data['password']}) self.logDebug(page) xml = dom.parseString(page) exp_time = time() + int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue) * 24 * 60 * 60 diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index 049ee9f77..ced49125a 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -16,11 +16,11 @@ class FastixRu(Account): def loadAccountInfo(self, user, req): data = self.getAccountData(user) - page = req.load("http://fastix.ru/api_v2/?apikey=%s&sub=getaccountdetails" % (data['api'])) - page = json_loads(page) + page = json_loads(req.load("http://fastix.ru/api_v2/", get={'apikey': data['api'], 'sub': "getaccountdetails"})) + points = page['points'] - kb = float(points) - kb = kb * 1024 ** 2 / 1000 + kb = float(points) * 1024 ** 2 / 1000 + if points > 0: account_info = {"validuntil": -1, "trafficleft": kb} else: @@ -29,7 +29,8 @@ class FastixRu(Account): def login(self, user, data, req): - page = req.load("http://fastix.ru/api_v2/?sub=get_apikey&email=%s&password=%s" % (user, data['password'])) + page = req.load("http://fastix.ru/api_v2/", + get={'sub': "get_apikey", 'email': user, 'password': data['password']}) api = json_loads(page) api = api['apikey'] data['api'] = api diff --git a/module/plugins/accounts/NetloadIn.py b/module/plugins/accounts/NetloadIn.py index be0b8632c..6565e6899 100755 --- a/module/plugins/accounts/NetloadIn.py +++ b/module/plugins/accounts/NetloadIn.py @@ -18,7 +18,7 @@ class NetloadIn(Account): def loadAccountInfo(self, user, req): - page = req.load("http://netload.in/index.php?id=2&lang=de") + page = req.load("http://netload.in/index.php", get={'id': 2, 'lang': "de"}) left = r'>(\d+) (Tag|Tage), (\d+) Stunden<' left = re.search(left, page) if left: diff --git a/module/plugins/accounts/PremiumTo.py b/module/plugins/accounts/PremiumTo.py index 44bce1c7c..c1a8c661a 100644 --- a/module/plugins/accounts/PremiumTo.py +++ b/module/plugins/accounts/PremiumTo.py @@ -26,8 +26,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?username=%s&password=%s" % ( - user, self.password)).strip() + authcode = req.load("http://premium.to/api/getauthcode.php", + get={'username': user, 'password': self.password}).strip() if "wrong username" in authcode: self.wrongPassword() diff --git a/module/plugins/accounts/PremiumizeMe.py b/module/plugins/accounts/PremiumizeMe.py index 951c340e1..6603165e0 100644 --- a/module/plugins/accounts/PremiumizeMe.py +++ b/module/plugins/accounts/PremiumizeMe.py @@ -42,7 +42,8 @@ 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( - "https://api.premiumize.me/pm-api/v1.php?method=accountstatus¶ms[login]=%s¶ms[pass]=%s" % ( - user, self.accounts[user]['password'])) + answer = req.load("https://api.premiumize.me/pm-api/v1.php", + get={'method' : "accountstatus", + 'params[login]': user, + 'params[pass]' : self.accounts[user]['password']}) return json_loads(answer) diff --git a/module/plugins/accounts/RehostTo.py b/module/plugins/accounts/RehostTo.py index 8046f84c0..16702e632 100644 --- a/module/plugins/accounts/RehostTo.py +++ b/module/plugins/accounts/RehostTo.py @@ -15,12 +15,14 @@ class RehostTo(Account): def loadAccountInfo(self, user, req): data = self.getAccountData(user) - page = req.load("http://rehost.to/api.php?cmd=login&user=%s&pass=%s" % (user, data['password'])) + page = req.load("http://rehost.to/api.php", + get={'cmd': "login", 'user': user, 'pass': data['password']}) data = [x.split("=") for x in page.split(",")] ses = data[0][1] long_ses = data[1][1] - page = req.load("http://rehost.to/api.php?cmd=get_premium_credits&long_ses=%s" % long_ses) + page = req.load("http://rehost.to/api.php", + get={'cmd': "get_premium_credits", 'long_ses': long_ses}) traffic, valid = page.split(",") account_info = {"trafficleft": int(traffic) * 1024, @@ -32,7 +34,8 @@ class RehostTo(Account): def login(self, user, data, req): - page = req.load("http://rehost.to/api.php?cmd=login&user=%s&pass=%s" % (user, data['password'])) + page = req.load("http://rehost.to/api.php", + get={'cmd': "login", 'user': user, 'pass': data['password']}) if "Login failed." in page: self.wrongPassword() |