From 8d2ce2b8c169b801c9e98d96cb2c2e6aa1c25f19 Mon Sep 17 00:00:00 2001 From: Guidobelix Date: Tue, 16 Sep 2014 17:02:29 +0200 Subject: Update EasybytezCom --- module/plugins/accounts/EasybytezCom.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'module') diff --git a/module/plugins/accounts/EasybytezCom.py b/module/plugins/accounts/EasybytezCom.py index 105c365b5..564549521 100644 --- a/module/plugins/accounts/EasybytezCom.py +++ b/module/plugins/accounts/EasybytezCom.py @@ -11,7 +11,7 @@ from module.utils import parseFileSize class EasybytezCom(Account): __name__ = "EasybytezCom" __type__ = "account" - __version__ = "0.05" + __version__ = "0.06" __description__ = """EasyBytez.com account plugin""" __author_name__ = ("zoidberg", "guidobelix") @@ -24,24 +24,26 @@ class EasybytezCom(Account): def loadAccountInfo(self, user, req): html = req.load("http://www.easybytez.com/?op=my_account", decode=True) - validuntil = -1 + validuntil = None trafficleft = None premium = False m = re.search(self.VALID_UNTIL_PATTERN, html) if m: + expiredate = m.group(1) + self.logDebug("Expire date: " + expiredate) + try: - expiredate = m.group(1) - self.logDebug("Expire date: " + expiredate) validuntil = mktime(strptime(expiredate, "%d %B %Y")) except Exception, e: self.logError(e) + + if validuntil > mktime(gmtime()): + premium = True + trafficleft = -1 else: - if validuntil > mktime(gmtime()): - premium = True - trafficleft = -1 - else: - premium = False + premium = False + validuntil = -1 m = re.search(self.TRAFFIC_LEFT_PATTERN, html) if m: -- cgit v1.2.3