diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-10-02 22:14:08 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-10-02 22:14:08 +0200 |
commit | 5a679eeada699b74e29bf8947d25ae3e83289180 (patch) | |
tree | 61ee647b97ecf14a7d3516f29962507e70b3a560 /module/plugins/accounts/ShareonlineBiz.py | |
parent | urlencode fix (diff) | |
download | pyload-5a679eeada699b74e29bf8947d25ae3e83289180.tar.xz |
improved accountmanager
Diffstat (limited to 'module/plugins/accounts/ShareonlineBiz.py')
-rw-r--r-- | module/plugins/accounts/ShareonlineBiz.py | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 2eb78bf43..e7405c659 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -29,22 +29,17 @@ class ShareonlineBiz(Account): __author_name__ = ("mkaay") __author_mail__ = ("mkaay@mkaay.de") - def getAccountInfo(self, user): - try: - req = self.core.requestFactory.getRequest(self.__name__, 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"))) - - out = Account.getAccountInfo(self, user) - tmp = {"validuntil":validuntil, "trafficleft":-1} - out.update(tmp) - return out - except: - return Account.getAccountInfo(self, user) + 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 login(self, user, data): - req = self.core.requestFactory.getRequest(self.__name__, user) + req = self.getAccountRequest(user) post_vars = {"user": user, "pass": data["password"], "l_rememberme":"1"} |