From 20ad288fbce13c553013dee2a674d8e362ee7a45 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 18 Jan 2015 17:27:32 +0100 Subject: [CatShareNet] Update (2) --- module/plugins/accounts/CatShareNet.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/CatShareNet.py b/module/plugins/accounts/CatShareNet.py index dc1d6e372..ec4d706ae 100644 --- a/module/plugins/accounts/CatShareNet.py +++ b/module/plugins/accounts/CatShareNet.py @@ -10,15 +10,15 @@ from module.plugins.Account import Account class CatShareNet(Account): __name__ = "CatShareNet" __type__ = "account" - __version__ = "0.04" + __version__ = "0.05" __description__ = """CatShareNet account plugin""" __license__ = "GPLv3" __authors__ = [("prOq", None)] - PREMIUM_PATTERN = r'
  • Konto:[\s\n]*(\w*)' - VALID_UNTIL_PATTERN = r'Konto premium.*?(.*?)' + PREMIUM_PATTERN = r'Konto:[\s\n]*Premium' + VALID_UNTIL_PATTERN = r'>Konto premium.*?(.*?)' TRAFFIC_LEFT_PATTERN = r'([0-9.]+ [kMG]B)' @@ -29,12 +29,8 @@ class CatShareNet(Account): html = req.load("http://catshare.net/", decode=True) - try: - if "Premium" in re.search(self.PREMIUM_PATTERN, html).group(1): - premium = True - - except Exception: - pass + if re.search(self.PREMIUM_PATTERN, html): + premium = True try: expiredate = re.search(self.VALID_UNTIL_PATTERN, html).group(1) -- cgit v1.2.3