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/MegasharesCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/MegasharesCom.py') diff --git a/module/plugins/accounts/MegasharesCom.py b/module/plugins/accounts/MegasharesCom.py index 3d7ddbe46..d9ef7abb9 100644 --- a/module/plugins/accounts/MegasharesCom.py +++ b/module/plugins/accounts/MegasharesCom.py @@ -3,13 +3,13 @@ import re import time -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class MegasharesCom(Account): __name__ = "MegasharesCom" __type__ = "account" - __version__ = "0.03" + __version__ = "0.04" __description__ = """Megashares.com 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/MegasharesCom.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/MegasharesCom.py') diff --git a/module/plugins/accounts/MegasharesCom.py b/module/plugins/accounts/MegasharesCom.py index d9ef7abb9..af0987ed3 100644 --- a/module/plugins/accounts/MegasharesCom.py +++ b/module/plugins/accounts/MegasharesCom.py @@ -21,7 +21,7 @@ class MegasharesCom(Account): def loadAccountInfo(self, user, req): #self.relogin(user) - html = req.load("http://d01.megashares.com/myms.php", decode=True) + html = self.load("http://d01.megashares.com/myms.php", req=req) premium = False if '>Premium Upgrade<' in html else True @@ -37,12 +37,11 @@ class MegasharesCom(Account): def login(self, user, data, req): - html = req.load('http://d01.megashares.com/myms_login.php', + html = self.load('http://d01.megashares.com/myms_login.php', post={"httpref" : "", "myms_login" : "Login", "mymslogin_name": user, - "mymspassword" : data['password']}, - decode=True) + "mymspassword" : data['password']}, req=req) if not '%s' % user 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/MegasharesCom.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/accounts/MegasharesCom.py') diff --git a/module/plugins/accounts/MegasharesCom.py b/module/plugins/accounts/MegasharesCom.py index af0987ed3..3aa26692c 100644 --- a/module/plugins/accounts/MegasharesCom.py +++ b/module/plugins/accounts/MegasharesCom.py @@ -9,7 +9,7 @@ from module.plugins.internal.Account import Account class MegasharesCom(Account): __name__ = "MegasharesCom" __type__ = "account" - __version__ = "0.04" + __version__ = "0.05" __description__ = """Megashares.com account plugin""" __license__ = "GPLv3" @@ -19,8 +19,8 @@ class MegasharesCom(Account): VALID_UNTIL_PATTERN = r'

Period Ends: (\w{3} \d{1,2}, \d{4})

' - def loadAccountInfo(self, user, req): - #self.relogin(user) + def load_account_info(self, user, req): + # self.relogin(user) html = self.load("http://d01.megashares.com/myms.php", req=req) premium = False if '>Premium Upgrade<' in html else True @@ -28,10 +28,10 @@ class MegasharesCom(Account): validuntil = trafficleft = -1 try: timestr = re.search(self.VALID_UNTIL_PATTERN, html).group(1) - self.logDebug(timestr) + self.log_debug(timestr) validuntil = time.mktime(time.strptime(timestr, "%b %d, %Y")) except Exception, e: - self.logError(e) + self.log_error(e) return {"validuntil": validuntil, "trafficleft": -1, "premium": premium} @@ -44,4 +44,4 @@ class MegasharesCom(Account): "mymspassword" : data['password']}, req=req) if not '%s' % user 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/MegasharesCom.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/MegasharesCom.py') diff --git a/module/plugins/accounts/MegasharesCom.py b/module/plugins/accounts/MegasharesCom.py index 3aa26692c..d68002783 100644 --- a/module/plugins/accounts/MegasharesCom.py +++ b/module/plugins/accounts/MegasharesCom.py @@ -38,10 +38,11 @@ class MegasharesCom(Account): def login(self, user, data, req): html = self.load('http://d01.megashares.com/myms_login.php', - post={"httpref" : "", - "myms_login" : "Login", - "mymslogin_name": user, - "mymspassword" : data['password']}, req=req) + post={"httpref" : "", + "myms_login" : "Login", + "mymslogin_name": user, + "mymspassword" : data['password']}, + req=req) if not '%s' % user 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/MegasharesCom.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module/plugins/accounts/MegasharesCom.py') diff --git a/module/plugins/accounts/MegasharesCom.py b/module/plugins/accounts/MegasharesCom.py index d68002783..c91782a5f 100644 --- a/module/plugins/accounts/MegasharesCom.py +++ b/module/plugins/accounts/MegasharesCom.py @@ -21,7 +21,7 @@ class MegasharesCom(Account): def load_account_info(self, user, req): # self.relogin(user) - html = self.load("http://d01.megashares.com/myms.php", req=req) + html = self.load("http://d01.megashares.com/myms.php") premium = False if '>Premium Upgrade<' in html else True @@ -41,8 +41,7 @@ class MegasharesCom(Account): post={"httpref" : "", "myms_login" : "Login", "mymslogin_name": user, - "mymspassword" : data['password']}, - req=req) + "mymspassword" : data['password']}) if not '%s' % user 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/MegasharesCom.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/accounts/MegasharesCom.py') diff --git a/module/plugins/accounts/MegasharesCom.py b/module/plugins/accounts/MegasharesCom.py index c91782a5f..62bf71877 100644 --- a/module/plugins/accounts/MegasharesCom.py +++ b/module/plugins/accounts/MegasharesCom.py @@ -33,15 +33,15 @@ class MegasharesCom(Account): except Exception, e: self.log_error(e) - return {"validuntil": validuntil, "trafficleft": -1, "premium": premium} + return {'validuntil': validuntil, 'trafficleft': -1, 'premium': premium} def login(self, user, data, req): html = self.load('http://d01.megashares.com/myms_login.php', - post={"httpref" : "", - "myms_login" : "Login", - "mymslogin_name": user, - "mymspassword" : data['password']}) + post={'httpref' : "", + 'myms_login' : "Login", + 'mymslogin_name': user, + 'mymspassword' : data['password']}) if not '%s' % user in html: self.wrong_password() -- 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/MegasharesCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/MegasharesCom.py') diff --git a/module/plugins/accounts/MegasharesCom.py b/module/plugins/accounts/MegasharesCom.py index 62bf71877..a4d9c241f 100644 --- a/module/plugins/accounts/MegasharesCom.py +++ b/module/plugins/accounts/MegasharesCom.py @@ -10,6 +10,7 @@ class MegasharesCom(Account): __name__ = "MegasharesCom" __type__ = "account" __version__ = "0.05" + __status__ = "stable" __description__ = """Megashares.com 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/MegasharesCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/MegasharesCom.py') diff --git a/module/plugins/accounts/MegasharesCom.py b/module/plugins/accounts/MegasharesCom.py index a4d9c241f..51c410e1c 100644 --- a/module/plugins/accounts/MegasharesCom.py +++ b/module/plugins/accounts/MegasharesCom.py @@ -10,7 +10,7 @@ class MegasharesCom(Account): __name__ = "MegasharesCom" __type__ = "account" __version__ = "0.05" - __status__ = "stable" + __status__ = "testing" __description__ = """Megashares.com 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/MegasharesCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/MegasharesCom.py') diff --git a/module/plugins/accounts/MegasharesCom.py b/module/plugins/accounts/MegasharesCom.py index 51c410e1c..ef6724512 100644 --- a/module/plugins/accounts/MegasharesCom.py +++ b/module/plugins/accounts/MegasharesCom.py @@ -20,7 +20,7 @@ class MegasharesCom(Account): VALID_UNTIL_PATTERN = r'

Period Ends: (\w{3} \d{1,2}, \d{4})

' - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): # self.relogin(user) html = self.load("http://d01.megashares.com/myms.php") @@ -37,12 +37,12 @@ class MegasharesCom(Account): return {'validuntil': validuntil, 'trafficleft': -1, 'premium': premium} - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load('http://d01.megashares.com/myms_login.php', post={'httpref' : "", 'myms_login' : "Login", 'mymslogin_name': user, - 'mymspassword' : data['password']}) + 'mymspassword' : password}) if not '%s' % user 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/MegasharesCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/MegasharesCom.py') diff --git a/module/plugins/accounts/MegasharesCom.py b/module/plugins/accounts/MegasharesCom.py index ef6724512..ec43b7fc0 100644 --- a/module/plugins/accounts/MegasharesCom.py +++ b/module/plugins/accounts/MegasharesCom.py @@ -45,4 +45,4 @@ class MegasharesCom(Account): 'mymspassword' : password}) if not '%s' % user in html: - self.fail() + self.login_fail() -- cgit v1.2.3