diff options
| author | 2010-10-02 22:14:08 +0200 | |
|---|---|---|
| committer | 2010-10-02 22:14:08 +0200 | |
| commit | 5a679eeada699b74e29bf8947d25ae3e83289180 (patch) | |
| tree | 61ee647b97ecf14a7d3516f29962507e70b3a560 /module/plugins/accounts/FileserveCom.py | |
| parent | urlencode fix (diff) | |
| download | pyload-5a679eeada699b74e29bf8947d25ae3e83289180.tar.xz | |
improved accountmanager
Diffstat (limited to 'module/plugins/accounts/FileserveCom.py')
| -rw-r--r-- | module/plugins/accounts/FileserveCom.py | 34 | 
1 files changed, 14 insertions, 20 deletions
| diff --git a/module/plugins/accounts/FileserveCom.py b/module/plugins/accounts/FileserveCom.py index 1fdb4c40b..27cad18bd 100644 --- a/module/plugins/accounts/FileserveCom.py +++ b/module/plugins/accounts/FileserveCom.py @@ -29,28 +29,22 @@ class FileserveCom(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://fileserve.com/dashboard.php", cookies=True) -             -            out = Account.getAccountInfo(self, user) -             -            m = re.search(r"<td><h4>Premium Until</h4></th> <td><h5>(.*?) E(.)T</h5></td>", src) -            if m: -                zone = -5 if m.group(2) == "S" else -4 -                validuntil = int(mktime(strptime(m.group(1), "%d %B %Y"))) + 24*3600 + (zone*3600) -                tmp = {"validuntil":validuntil, "trafficleft":-1} -            else: -                tmp = {"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://fileserve.com/dashboard.php", cookies=True) + +        m = re.search(r"<td><h4>Premium Until</h4></th> <td><h5>(.*?) E(.)T</h5></td>", src) +        if m: +            zone = -5 if m.group(2) == "S" else -4 +            validuntil = int(mktime(strptime(m.group(1), "%d %B %Y"))) + 24*3600 + (zone*3600) +            tmp = {"validuntil":validuntil, "trafficleft":-1} +        else: +            tmp = {"trafficleft":-1} +        return tmp      def login(self, user, data): -        req = self.core.requestFactory.getRequest(self.__name__, user) +        req = self.getAccountRequest(user)          req.load("http://fileserve.com/login.php",                  post={"loginUserName": user, "loginUserPassword": data["password"],                        "autoLogin": "on", "loginFormSubmit": "Login"}, cookies=True) | 
