From 0e1ef9bc01579328e17e79416fa3c1c7b77adcc8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Jun 2015 06:08:01 +0200 Subject: Update everything --- module/plugins/accounts/NowVideoSx.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/NowVideoSx.py') diff --git a/module/plugins/accounts/NowVideoSx.py b/module/plugins/accounts/NowVideoSx.py index 2f7b033bd..a0cc90790 100644 --- a/module/plugins/accounts/NowVideoSx.py +++ b/module/plugins/accounts/NowVideoSx.py @@ -3,13 +3,13 @@ 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.04" __description__ = """NowVideo.at account plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From c1764e2fea0bb05164c83a876e8cd58b97f58f25 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 16 Jun 2015 17:31:38 +0200 Subject: Update all --- module/plugins/accounts/NowVideoSx.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/NowVideoSx.py') diff --git a/module/plugins/accounts/NowVideoSx.py b/module/plugins/accounts/NowVideoSx.py index a0cc90790..81267d413 100644 --- a/module/plugins/accounts/NowVideoSx.py +++ b/module/plugins/accounts/NowVideoSx.py @@ -24,7 +24,7 @@ class NowVideoSx(Account): trafficleft = -1 premium = None - html = req.load("http://www.nowvideo.sx/premium.php") + html = self.load("http://www.nowvideo.sx/premium.php", req=req) m = re.search(self.VALID_UNTIL_PATTERN, html) if m: @@ -48,9 +48,8 @@ class NowVideoSx(Account): def login(self, user, data, req): - html = req.load("http://www.nowvideo.sx/login.php", - post={'user': user, 'pass': data['password']}, - decode=True) + html = self.load("http://www.nowvideo.sx/login.php", + post={'user': user, 'pass': data['password']}, req=req) if re.search(r'>Log In<', html): self.wrongPassword() -- cgit v1.2.3 From b1759bc440cd6013837697eb8de540914f693ffd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Jul 2015 01:23:55 +0200 Subject: No camelCase style anymore --- module/plugins/accounts/NowVideoSx.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/accounts/NowVideoSx.py') diff --git a/module/plugins/accounts/NowVideoSx.py b/module/plugins/accounts/NowVideoSx.py index 81267d413..e679367d6 100644 --- a/module/plugins/accounts/NowVideoSx.py +++ b/module/plugins/accounts/NowVideoSx.py @@ -9,7 +9,7 @@ from module.plugins.internal.Account import Account class NowVideoSx(Account): __name__ = "NowVideoSx" __type__ = "account" - __version__ = "0.04" + __version__ = "0.05" __description__ = """NowVideo.at account plugin""" __license__ = "GPLv3" @@ -19,7 +19,7 @@ class NowVideoSx(Account): VALID_UNTIL_PATTERN = r'>Your premium membership expires on: (.+?)<' - def loadAccountInfo(self, user, req): + def load_account_info(self, user, req): validuntil = None trafficleft = -1 premium = None @@ -29,13 +29,13 @@ class NowVideoSx(Account): 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()): @@ -52,4 +52,4 @@ class NowVideoSx(Account): post={'user': user, 'pass': data['password']}, req=req) if re.search(r'>Log In<', html): - self.wrongPassword() + self.wrong_password() -- cgit v1.2.3 From d2e2b127651a5a44b56337eb6d9ca246c97a208a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 17 Jul 2015 03:03:26 +0200 Subject: Spare fixes and code cosmetics --- module/plugins/accounts/NowVideoSx.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'module/plugins/accounts/NowVideoSx.py') diff --git a/module/plugins/accounts/NowVideoSx.py b/module/plugins/accounts/NowVideoSx.py index e679367d6..6f6093dbb 100644 --- a/module/plugins/accounts/NowVideoSx.py +++ b/module/plugins/accounts/NowVideoSx.py @@ -49,7 +49,9 @@ class NowVideoSx(Account): def login(self, user, data, req): html = self.load("http://www.nowvideo.sx/login.php", - post={'user': user, 'pass': data['password']}, req=req) + post={'user': user, + 'pass': data['password']}, + req=req) if re.search(r'>Log In<', html): self.wrong_password() -- cgit v1.2.3 From 1f5a55ae2133a782bdcca334ecbcdbde50dbcf99 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 17 Jul 2015 15:29:48 +0200 Subject: No more need to use the req argument when call load method --- module/plugins/accounts/NowVideoSx.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module/plugins/accounts/NowVideoSx.py') diff --git a/module/plugins/accounts/NowVideoSx.py b/module/plugins/accounts/NowVideoSx.py index 6f6093dbb..47fedb044 100644 --- a/module/plugins/accounts/NowVideoSx.py +++ b/module/plugins/accounts/NowVideoSx.py @@ -24,7 +24,7 @@ class NowVideoSx(Account): trafficleft = -1 premium = None - html = self.load("http://www.nowvideo.sx/premium.php", req=req) + html = self.load("http://www.nowvideo.sx/premium.php") m = re.search(self.VALID_UNTIL_PATTERN, html) if m: @@ -50,8 +50,7 @@ class NowVideoSx(Account): def login(self, user, data, req): html = self.load("http://www.nowvideo.sx/login.php", post={'user': user, - 'pass': data['password']}, - req=req) + 'pass': data['password']}) if re.search(r'>Log In<', html): self.wrong_password() -- cgit v1.2.3 From ff9383bfe06d14d23bc0ed6af79aa8967965d078 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 10:59:52 +0200 Subject: Code cosmetics (3) --- module/plugins/accounts/NowVideoSx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/NowVideoSx.py') diff --git a/module/plugins/accounts/NowVideoSx.py b/module/plugins/accounts/NowVideoSx.py index 47fedb044..c4c930508 100644 --- a/module/plugins/accounts/NowVideoSx.py +++ b/module/plugins/accounts/NowVideoSx.py @@ -44,7 +44,7 @@ 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): -- cgit v1.2.3 From d38e830b7c0b3c6561a0072c74bbccb5fcdf4a61 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 14:43:42 +0200 Subject: New __status__ magic key --- module/plugins/accounts/NowVideoSx.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/NowVideoSx.py') diff --git a/module/plugins/accounts/NowVideoSx.py b/module/plugins/accounts/NowVideoSx.py index c4c930508..356600822 100644 --- a/module/plugins/accounts/NowVideoSx.py +++ b/module/plugins/accounts/NowVideoSx.py @@ -10,6 +10,7 @@ class NowVideoSx(Account): __name__ = "NowVideoSx" __type__ = "account" __version__ = "0.05" + __status__ = "stable" __description__ = """NowVideo.at account plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 94d017cd2a5c1f194960827a8c7e46afc3682008 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 06:55:49 +0200 Subject: Hotfixes (2) --- module/plugins/accounts/NowVideoSx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/NowVideoSx.py') diff --git a/module/plugins/accounts/NowVideoSx.py b/module/plugins/accounts/NowVideoSx.py index 356600822..bb64a2e62 100644 --- a/module/plugins/accounts/NowVideoSx.py +++ b/module/plugins/accounts/NowVideoSx.py @@ -10,7 +10,7 @@ class NowVideoSx(Account): __name__ = "NowVideoSx" __type__ = "account" __version__ = "0.05" - __status__ = "stable" + __status__ = "testing" __description__ = """NowVideo.at account plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 8f17f875f6e28f73ddb10da59c6464bd04922222 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Jul 2015 04:59:27 +0200 Subject: Account rewritten --- module/plugins/accounts/NowVideoSx.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/NowVideoSx.py') diff --git a/module/plugins/accounts/NowVideoSx.py b/module/plugins/accounts/NowVideoSx.py index bb64a2e62..8d4add5f6 100644 --- a/module/plugins/accounts/NowVideoSx.py +++ b/module/plugins/accounts/NowVideoSx.py @@ -20,7 +20,7 @@ class NowVideoSx(Account): VALID_UNTIL_PATTERN = r'>Your premium membership expires on: (.+?)<' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): validuntil = None trafficleft = -1 premium = None @@ -48,10 +48,10 @@ class NowVideoSx(Account): return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load("http://www.nowvideo.sx/login.php", post={'user': user, - 'pass': data['password']}) + 'pass': password}) if re.search(r'>Log In<', html): - self.wrong_password() + self.fail() -- cgit v1.2.3 From a95c217627a1cb651b24e69f20640df40797aff9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Jul 2015 09:34:18 +0200 Subject: Account rewritten (2) --- module/plugins/accounts/NowVideoSx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/NowVideoSx.py') diff --git a/module/plugins/accounts/NowVideoSx.py b/module/plugins/accounts/NowVideoSx.py index 8d4add5f6..73bb383be 100644 --- a/module/plugins/accounts/NowVideoSx.py +++ b/module/plugins/accounts/NowVideoSx.py @@ -54,4 +54,4 @@ class NowVideoSx(Account): 'pass': password}) if re.search(r'>Log In<', html): - self.fail() + self.login_fail() -- cgit v1.2.3