diff options
author | Jeix <devnull@localhost> | 2010-10-03 14:19:51 +0200 |
---|---|---|
committer | Jeix <devnull@localhost> | 2010-10-03 14:19:51 +0200 |
commit | 78413c410e875db8d652f976183717cf3add33f4 (patch) | |
tree | 73082a856d747e1cf9e2fb0b9d88e38c9a076f1a /module/plugins/accounts/ShareonlineBiz.py | |
parent | fix 3. (diff) | |
download | pyload-78413c410e875db8d652f976183717cf3add33f4.tar.xz |
share-online premium fix (revert to old design, coz new one is still buggy)
Diffstat (limited to 'module/plugins/accounts/ShareonlineBiz.py')
-rw-r--r-- | module/plugins/accounts/ShareonlineBiz.py | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index e7405c659..a85dbbe71 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -29,19 +29,29 @@ class ShareonlineBiz(Account): __author_name__ = ("mkaay") __author_mail__ = ("mkaay@mkaay.de") - def loadAccountInfo(self, user): - req = self.getAccountRequest(user) - src = req.load("http://www.share-online.biz/alpha/lang/set/english") - validuntil = re.search(r"Account valid till:.*?<span class='.*?'>(.*?)</span>", src, re.S).group(1) - validuntil = int(mktime(strptime(validuntil, "%m/%d/%Y, %I:%M:%S %p"))) - - tmp = {"validuntil":validuntil, "trafficleft":-1} - return tmp + def getAccountInfo(self, user): + try: + req = self.core.requestFactory.getRequest(self.__name__, user) + src = req.load("http://www.share-online.biz/members.php?setlang=en") + validuntil = re.search(r'<td align="left"><b>Package Expire Date:</b></td>\s*<td align="left">(\d+/\d+/\d+</td>', src).group(1) + validuntil = int(mktime(strptime(validuntil, "%m/%d/%Y"))) + + out = Account.getAccountInfo(self, user) + tmp = {"validuntil":validuntil, "trafficleft":-1} + out.update(tmp) + return out + except: + return Account.getAccountInfo(self, user) def login(self, user, data): - req = self.getAccountRequest(user) - post_vars = {"user": user, + req = self.core.requestFactory.getRequest(self.__name__, user) + post_vars = { + "act": "login", + "location": "index.php", + "dieseid": "", + "user": user, "pass": data["password"], - "l_rememberme":"1"} - req.lastURL = "http://www.share-online.biz/alpha/" - req.load("https://www.share-online.biz/alpha/user/login", cookies=True, post=post_vars) + "login": "Login" + } + req.lastURL = "http://www.share-online.biz/" + req.load("https://www.share-online.biz/login.php", cookies=True, post=post_vars) |