From 48c0c42fd6faffc56432d5f037cd575979f180cc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 02:23:37 +0200 Subject: Removed all @author flags + key attributes cleanup for internal & hooks plugins --- module/plugins/accounts/ShareonlineBiz.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/accounts/ShareonlineBiz.py') diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index f188fc580..37ca373e4 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: mkaay """ from module.plugins.Account import Account -- cgit v1.2.3 From 7b8c458cca7d21a029620f98e453f746fce69cd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 16:10:01 +0200 Subject: Prefer single quote for dict key name --- module/plugins/accounts/ShareonlineBiz.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'module/plugins/accounts/ShareonlineBiz.py') diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 37ca373e4..f8c9f4fe0 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -28,7 +28,7 @@ class ShareonlineBiz(Account): def getUserAPI(self, user, req): return req.load("http://api.share-online.biz/account.php", - {"username": user, "password": self.accounts[user]["password"], "act": "userDetails"}) + {"username": user, "password": self.accounts[user]['password'], "act": "userDetails"}) def loadAccountInfo(self, user, req): src = self.getUserAPI(user, req) @@ -40,14 +40,14 @@ class ShareonlineBiz(Account): info[key] = value self.logDebug(info) - if "dl" in info and info["dl"].lower() != "not_available": - req.cj.setCookie("share-online.biz", "dl", info["dl"]) - if "a" in info and info["a"].lower() != "not_available": - req.cj.setCookie("share-online.biz", "a", info["a"]) + if "dl" in info and info['dl'].lower() != "not_available": + req.cj.setCookie("share-online.biz", "dl", info['dl']) + if "a" in info and info['a'].lower() != "not_available": + req.cj.setCookie("share-online.biz", "a", info['a']) - return {"validuntil": int(info["expire_date"]) if "expire_date" in info else -1, + return {"validuntil": int(info['expire_date']) if "expire_date" in info else -1, "trafficleft": -1, - "premium": True if ("dl" in info or "a" in info) and (info["group"] != "Sammler") else False} + "premium": True if ("dl" in info or "a" in info) and (info['group'] != "Sammler") else False} def login(self, user, data, req): src = self.getUserAPI(user, req) -- cgit v1.2.3 From 8e47b0de30a25d0fd5dfb518bfe4e1e7beff93fd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 16:27:44 +0200 Subject: Key attributes cleanup for account, container and crypter plugins --- module/plugins/accounts/ShareonlineBiz.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/plugins/accounts/ShareonlineBiz.py') diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index f8c9f4fe0..9f706d186 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -22,10 +22,12 @@ class ShareonlineBiz(Account): __name__ = "ShareonlineBiz" __version__ = "0.24" __type__ = "account" + __description__ = """Share-online.biz account plugin""" __author_name__ = ("mkaay", "zoidberg") __author_mail__ = ("mkaay@mkaay.de", "zoidberg@mujmail.cz") + def getUserAPI(self, user, req): return req.load("http://api.share-online.biz/account.php", {"username": user, "password": self.accounts[user]['password'], "act": "userDetails"}) -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/accounts/ShareonlineBiz.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'module/plugins/accounts/ShareonlineBiz.py') diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 9f706d186..b9ff0096c 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -1,27 +1,12 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" - from module.plugins.Account import Account class ShareonlineBiz(Account): __name__ = "ShareonlineBiz" - __version__ = "0.24" __type__ = "account" + __version__ = "0.24" __description__ = """Share-online.biz account plugin""" __author_name__ = ("mkaay", "zoidberg") -- cgit v1.2.3 From b0868ae6446078bacf1635dde5e4ab316b4a94cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Oct 2014 18:57:59 +0200 Subject: New __authors__ key replaces __author_name__ and __author_mail__ + Whitespaces and EOF fixup --- module/plugins/accounts/ShareonlineBiz.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/ShareonlineBiz.py') diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index b9ff0096c..54e23013b 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -9,8 +9,8 @@ class ShareonlineBiz(Account): __version__ = "0.24" __description__ = """Share-online.biz account plugin""" - __author_name__ = ("mkaay", "zoidberg") - __author_mail__ = ("mkaay@mkaay.de", "zoidberg@mujmail.cz") + __authors__ = [("mkaay", "mkaay@mkaay.de"), + ("zoidberg", "zoidberg@mujmail.cz")] def getUserAPI(self, user, req): -- cgit v1.2.3 From ae7a7e66981456e5bbe2b54006d79b6f907be7a4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- module/plugins/accounts/ShareonlineBiz.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/ShareonlineBiz.py') diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 54e23013b..d96dd2fe6 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -9,6 +9,7 @@ class ShareonlineBiz(Account): __version__ = "0.24" __description__ = """Share-online.biz account plugin""" + __license__ = "GPLv3" __authors__ = [("mkaay", "mkaay@mkaay.de"), ("zoidberg", "zoidberg@mujmail.cz")] -- cgit v1.2.3 From 6a0fb7fdd4ea2749be44625225d8a235a78f032f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:42:39 +0200 Subject: [accounts] Code cosmetics --- module/plugins/accounts/ShareonlineBiz.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/ShareonlineBiz.py') diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index d96dd2fe6..76c564032 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -37,6 +37,7 @@ class ShareonlineBiz(Account): "trafficleft": -1, "premium": True if ("dl" in info or "a" in info) and (info['group'] != "Sammler") else False} + def login(self, user, data, req): src = self.getUserAPI(user, req) if "EXCEPTION" in src: -- cgit v1.2.3 From 0eb6e7ec4a1144dcca824d8add049787d3da1762 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 22 Oct 2014 19:44:59 +0200 Subject: Two space before function declaration --- module/plugins/accounts/ShareonlineBiz.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/ShareonlineBiz.py') diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 76c564032..c00e4769d 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -18,6 +18,7 @@ class ShareonlineBiz(Account): return req.load("http://api.share-online.biz/account.php", {"username": user, "password": self.accounts[user]['password'], "act": "userDetails"}) + def loadAccountInfo(self, user, req): src = self.getUserAPI(user, req) -- cgit v1.2.3 From 34984dae733c3f3d47b41a0acfba3724d53c65a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:52:10 +0100 Subject: Code cosmetics: plugin class attributes --- module/plugins/accounts/ShareonlineBiz.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/accounts/ShareonlineBiz.py') diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index c00e4769d..b0833f7af 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -4,14 +4,14 @@ from module.plugins.Account import Account class ShareonlineBiz(Account): - __name__ = "ShareonlineBiz" - __type__ = "account" + __name__ = "ShareonlineBiz" + __type__ = "account" __version__ = "0.24" __description__ = """Share-online.biz account plugin""" - __license__ = "GPLv3" - __authors__ = [("mkaay", "mkaay@mkaay.de"), - ("zoidberg", "zoidberg@mujmail.cz")] + __license__ = "GPLv3" + __authors__ = [("mkaay", "mkaay@mkaay.de"), + ("zoidberg", "zoidberg@mujmail.cz")] def getUserAPI(self, user, req): -- cgit v1.2.3 From c9e31d875d32de31e54959b82bc35eff2b3e0f3f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 10 Nov 2014 00:19:51 +0100 Subject: Code cosmetics --- module/plugins/accounts/ShareonlineBiz.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/accounts/ShareonlineBiz.py') diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index b0833f7af..331bb9f74 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -20,19 +20,19 @@ class ShareonlineBiz(Account): def loadAccountInfo(self, user, req): - src = self.getUserAPI(user, req) + html = self.getUserAPI(user, req) info = {} - for line in src.splitlines(): + for line in html.splitlines(): if "=" in line: key, value = line.split("=") info[key] = value self.logDebug(info) if "dl" in info and info['dl'].lower() != "not_available": - req.cj.setCookie("share-online.biz", "dl", info['dl']) + req.cj.setCookie(".share-online.biz", "dl", info['dl']) if "a" in info and info['a'].lower() != "not_available": - req.cj.setCookie("share-online.biz", "a", info['a']) + req.cj.setCookie(".share-online.biz", "a", info['a']) return {"validuntil": int(info['expire_date']) if "expire_date" in info else -1, "trafficleft": -1, @@ -40,6 +40,6 @@ class ShareonlineBiz(Account): def login(self, user, data, req): - src = self.getUserAPI(user, req) - if "EXCEPTION" in src: + html = self.getUserAPI(user, req) + if "EXCEPTION" in html: self.wrongPassword() -- cgit v1.2.3 From e8246525f3106c152d6d1436c6a3111e0334520f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 15 Nov 2014 18:04:47 +0100 Subject: Fix cookie domain --- module/plugins/accounts/ShareonlineBiz.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/ShareonlineBiz.py') diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 331bb9f74..976d2ff14 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -30,9 +30,9 @@ class ShareonlineBiz(Account): self.logDebug(info) if "dl" in info and info['dl'].lower() != "not_available": - req.cj.setCookie(".share-online.biz", "dl", info['dl']) + req.cj.setCookie("share-online.biz", "dl", info['dl']) if "a" in info and info['a'].lower() != "not_available": - req.cj.setCookie(".share-online.biz", "a", info['a']) + req.cj.setCookie("share-online.biz", "a", info['a']) return {"validuntil": int(info['expire_date']) if "expire_date" in info else -1, "trafficleft": -1, -- cgit v1.2.3 From fb65d5354c3cc80c3f48c3a2745b8dc01105edfd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 18 Dec 2014 16:02:29 +0100 Subject: Update account plugins --- module/plugins/accounts/ShareonlineBiz.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/ShareonlineBiz.py') diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 976d2ff14..596be9b7c 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -6,7 +6,7 @@ from module.plugins.Account import Account class ShareonlineBiz(Account): __name__ = "ShareonlineBiz" __type__ = "account" - __version__ = "0.24" + __version__ = "0.25" __description__ = """Share-online.biz account plugin""" __license__ = "GPLv3" @@ -34,7 +34,7 @@ class ShareonlineBiz(Account): if "a" in info and info['a'].lower() != "not_available": req.cj.setCookie("share-online.biz", "a", info['a']) - return {"validuntil": int(info['expire_date']) if "expire_date" in info else -1, + return {"validuntil": float(info['expire_date']) if "expire_date" in info else -1, "trafficleft": -1, "premium": True if ("dl" in info or "a" in info) and (info['group'] != "Sammler") else False} -- cgit v1.2.3 From 136f63dc39603814b215606f888fb2e639021277 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 26 Dec 2014 04:27:41 +0100 Subject: Spare code fixes --- module/plugins/accounts/ShareonlineBiz.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/accounts/ShareonlineBiz.py') diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 596be9b7c..49afa12b8 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -16,7 +16,7 @@ class ShareonlineBiz(Account): def getUserAPI(self, user, req): return req.load("http://api.share-online.biz/account.php", - {"username": user, "password": self.accounts[user]['password'], "act": "userDetails"}) + get={"username": user, "password": self.accounts[user]['password'], 'act': "userDetails"}) def loadAccountInfo(self, user, req): @@ -34,9 +34,9 @@ class ShareonlineBiz(Account): if "a" in info and info['a'].lower() != "not_available": req.cj.setCookie("share-online.biz", "a", info['a']) - return {"validuntil": float(info['expire_date']) if "expire_date" in info else -1, + return {"validuntil" : float(info['expire_date']) if "expire_date" in info else -1, "trafficleft": -1, - "premium": True if ("dl" in info or "a" in info) and (info['group'] != "Sammler") else False} + "premium" : True if ("dl" in info or "a" in info) and (info['group'] != "Sammler") else False} def login(self, user, data, req): -- cgit v1.2.3 From a2324280a11b22ef75f7c86bad3392a2179c486c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 26 Dec 2014 16:48:14 +0100 Subject: [ShareonlineBiz] Fix login --- module/plugins/accounts/ShareonlineBiz.py | 53 ++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 18 deletions(-) (limited to 'module/plugins/accounts/ShareonlineBiz.py') diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 49afa12b8..c08d6f963 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -6,40 +6,57 @@ from module.plugins.Account import Account class ShareonlineBiz(Account): __name__ = "ShareonlineBiz" __type__ = "account" - __version__ = "0.25" + __version__ = "0.26" __description__ = """Share-online.biz account plugin""" __license__ = "GPLv3" __authors__ = [("mkaay", "mkaay@mkaay.de"), - ("zoidberg", "zoidberg@mujmail.cz")] + ("zoidberg", "zoidberg@mujmail.cz"), + ("Walter Purcaro", "vuolter@gmail.com")] - def getUserAPI(self, user, req): - return req.load("http://api.share-online.biz/account.php", - get={"username": user, "password": self.accounts[user]['password'], 'act': "userDetails"}) + def api_response(self, user, req): + return req.load("http://api.share-online.biz/cgi-bin", + get={'q': "userdetails", 'aux': "traffic", "username": user, "password": self.accounts[user]['password']}) def loadAccountInfo(self, user, req): - html = self.getUserAPI(user, req) + premium = False + validuntil = None + trafficleft = -1 + maxtraffic = 100 * 1024 * 1024 * 1024 #: 100 GB - info = {} - for line in html.splitlines(): + api = {} + for line in self.api_response(user, req).splitlines(): if "=" in line: key, value = line.split("=") - info[key] = value - self.logDebug(info) + api[key] = value - if "dl" in info and info['dl'].lower() != "not_available": - req.cj.setCookie("share-online.biz", "dl", info['dl']) - if "a" in info and info['a'].lower() != "not_available": - req.cj.setCookie("share-online.biz", "a", info['a']) + self.logDebug(api) - return {"validuntil" : float(info['expire_date']) if "expire_date" in info else -1, - "trafficleft": -1, - "premium" : True if ("dl" in info or "a" in info) and (info['group'] != "Sammler") else False} + for key in ("dl", "a"): + if key not in api: + continue + + if api['group'] != "Sammler": + premium = True + + if api[key].lower() != "not_available": + req.cj.setCookie("share-online.biz", key, api[key]) + break + + if 'expire_date' in api: + validuntil = float(api['expire_date']) + + if 'traffic_1d' in api: + traffic = int(api['traffic_1d'].split(";")[0]) + maxtraffic = max(maxtraffic, traffic) + trafficleft = maxtraffic - traffic + + return {'premium': premium, 'validuntil': validuntil, 'trafficleft': trafficleft, 'maxtraffic': maxtraffic} def login(self, user, data, req): - html = self.getUserAPI(user, req) + html = self.api_response(user, req) if "EXCEPTION" in html: self.wrongPassword() -- cgit v1.2.3 From ff42cec46274b0f2019272424c1a57ec4b413507 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 26 Dec 2014 17:58:54 +0100 Subject: [PremiumTo] Fixup --- module/plugins/accounts/ShareonlineBiz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/ShareonlineBiz.py') diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index c08d6f963..fea278559 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -49,7 +49,7 @@ class ShareonlineBiz(Account): validuntil = float(api['expire_date']) if 'traffic_1d' in api: - traffic = int(api['traffic_1d'].split(";")[0]) + traffic = float(api['traffic_1d'].split(";")[0]) maxtraffic = max(maxtraffic, traffic) trafficleft = maxtraffic - traffic -- cgit v1.2.3 From 993803c222f54a6ae0a12230a5e51789ec8ed564 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Dec 2014 13:58:27 +0100 Subject: [ShareonlineBiz] Fix account wrong password recognition --- module/plugins/accounts/ShareonlineBiz.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/ShareonlineBiz.py') diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index fea278559..056f14876 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -6,7 +6,7 @@ from module.plugins.Account import Account class ShareonlineBiz(Account): __name__ = "ShareonlineBiz" __type__ = "account" - __version__ = "0.26" + __version__ = "0.27" __description__ = """Share-online.biz account plugin""" __license__ = "GPLv3" @@ -58,5 +58,7 @@ class ShareonlineBiz(Account): def login(self, user, data, req): html = self.api_response(user, req) - if "EXCEPTION" in html: + err = re.search(r'**(.+?)**', html) + if err: + self.logError(err.group(1)) self.wrongPassword() -- cgit v1.2.3 From 27f0f486bb859d25c49916d4131f882e1b5ba8dc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Dec 2014 21:13:09 +0100 Subject: [ShareonlineBiz] Account fixup --- module/plugins/accounts/ShareonlineBiz.py | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'module/plugins/accounts/ShareonlineBiz.py') diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 056f14876..3f737896e 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -1,18 +1,18 @@ # -*- coding: utf-8 -*- +import re + from module.plugins.Account import Account class ShareonlineBiz(Account): __name__ = "ShareonlineBiz" __type__ = "account" - __version__ = "0.27" + __version__ = "0.28" __description__ = """Share-online.biz account plugin""" __license__ = "GPLv3" - __authors__ = [("mkaay", "mkaay@mkaay.de"), - ("zoidberg", "zoidberg@mujmail.cz"), - ("Walter Purcaro", "vuolter@gmail.com")] + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] def api_response(self, user, req): @@ -34,21 +34,13 @@ class ShareonlineBiz(Account): self.logDebug(api) - for key in ("dl", "a"): - if key not in api: - continue - - if api['group'] != "Sammler": - premium = True + if api['a'].lower() != "not_available": + req.cj.setCookie("share-online.biz", 'a', api['a']) - if api[key].lower() != "not_available": - req.cj.setCookie("share-online.biz", key, api[key]) - break + premium = api['group'] == "Premium" - if 'expire_date' in api: validuntil = float(api['expire_date']) - if 'traffic_1d' in api: traffic = float(api['traffic_1d'].split(";")[0]) maxtraffic = max(maxtraffic, traffic) trafficleft = maxtraffic - traffic @@ -58,7 +50,7 @@ class ShareonlineBiz(Account): def login(self, user, data, req): html = self.api_response(user, req) - err = re.search(r'**(.+?)**', html) + err = re.search(r'\*\*(.+?)\*\*', html) if err: self.logError(err.group(1)) self.wrongPassword() -- cgit v1.2.3 From cef160bb1a77a7a30aa9dde0d8c708e769bc0533 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Dec 2014 23:37:03 +0100 Subject: [ShareonlineBiz] Account fixup (2) --- module/plugins/accounts/ShareonlineBiz.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module/plugins/accounts/ShareonlineBiz.py') diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 3f737896e..57fe52385 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -8,7 +8,7 @@ from module.plugins.Account import Account class ShareonlineBiz(Account): __name__ = "ShareonlineBiz" __type__ = "account" - __version__ = "0.28" + __version__ = "0.29" __description__ = """Share-online.biz account plugin""" __license__ = "GPLv3" @@ -45,6 +45,9 @@ class ShareonlineBiz(Account): maxtraffic = max(maxtraffic, traffic) trafficleft = maxtraffic - traffic + maxtraffic /= 1024 #@TODO: Remove `/ 1024` in 0.4.10 + trafficleft /= 1024 #@TODO: Remove `/ 1024` in 0.4.10 + return {'premium': premium, 'validuntil': validuntil, 'trafficleft': trafficleft, 'maxtraffic': maxtraffic} -- cgit v1.2.3