diff options
Diffstat (limited to 'module/plugins/accounts/NowVideoSx.py')
-rw-r--r-- | module/plugins/accounts/NowVideoSx.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/module/plugins/accounts/NowVideoSx.py b/module/plugins/accounts/NowVideoSx.py index 2f7b033bd..73bb383be 100644 --- a/module/plugins/accounts/NowVideoSx.py +++ b/module/plugins/accounts/NowVideoSx.py @@ -3,13 +3,14 @@ import re import time -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class NowVideoSx(Account): __name__ = "NowVideoSx" __type__ = "account" - __version__ = "0.03" + __version__ = "0.05" + __status__ = "testing" __description__ = """NowVideo.at account plugin""" __license__ = "GPLv3" @@ -19,23 +20,23 @@ class NowVideoSx(Account): VALID_UNTIL_PATTERN = r'>Your premium membership expires on: (.+?)<' - def loadAccountInfo(self, user, req): + def parse_info(self, user, password, data, req): validuntil = None trafficleft = -1 premium = None - html = req.load("http://www.nowvideo.sx/premium.php") + html = self.load("http://www.nowvideo.sx/premium.php") m = re.search(self.VALID_UNTIL_PATTERN, html) if m: expiredate = m.group(1).strip() - self.logDebug("Expire date: " + expiredate) + self.log_debug("Expire date: " + expiredate) try: validuntil = time.mktime(time.strptime(expiredate, "%Y-%b-%d")) except Exception, e: - self.logError(e) + self.log_error(e) else: if validuntil > time.mktime(time.gmtime()): @@ -44,13 +45,13 @@ class NowVideoSx(Account): premium = False validuntil = -1 - return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium} + return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} - def login(self, user, data, req): - html = req.load("http://www.nowvideo.sx/login.php", - post={'user': user, 'pass': data['password']}, - decode=True) + def login(self, user, password, data, req): + html = self.load("http://www.nowvideo.sx/login.php", + post={'user': user, + 'pass': password}) if re.search(r'>Log In<', html): - self.wrongPassword() + self.login_fail() |