summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/HotfileCom.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-08-18 22:39:07 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-08-18 22:39:07 +0200
commitab22498f73ba6376d0242c4f0a706b312cf6cdb6 (patch)
treed8d9e3051e5e8048157c852c7412d7ca0d4ffee6 /module/plugins/accounts/HotfileCom.py
parentfixes, missing file (diff)
downloadpyload-ab22498f73ba6376d0242c4f0a706b312cf6cdb6.tar.xz
account fixes
Diffstat (limited to 'module/plugins/accounts/HotfileCom.py')
-rw-r--r--module/plugins/accounts/HotfileCom.py43
1 files changed, 23 insertions, 20 deletions
diff --git a/module/plugins/accounts/HotfileCom.py b/module/plugins/accounts/HotfileCom.py
index af38b56a3..e6e8ba517 100644
--- a/module/plugins/accounts/HotfileCom.py
+++ b/module/plugins/accounts/HotfileCom.py
@@ -31,27 +31,30 @@ class HotfileCom(Account):
__author_mail__ = ("mkaay@mkaay.de")
def getAccountInfo(self, user):
- req = self.core.requestFactory.getRequest(self.__name__, user)
-
- resp = self.apiCall("getuserinfo", user=user)
- if resp.startswith("."):
- self.core.debug("HotfileCom API Error: %s" % resp)
- return None
- info = {}
- for p in resp.split("&"):
- key, value = p.split("=")
- info[key] = value
+ try:
+ req = self.core.requestFactory.getRequest(self.__name__, user)
- info["premium_until"] = info["premium_until"].replace("T"," ")
- zone = info["premium_until"][19:]
- info["premium_until"] = info["premium_until"][:19]
- zone = int(zone[:3])
-
- validuntil = int(mktime(strptime(info["premium_until"], "%Y-%m-%d %H:%M:%S"))) + (zone*3600)
- out = Account.getAccountInfo(self, user)
- tmp = {"validuntil":validuntil, "trafficleft":-1}
- out.update(tmp)
- return out
+ resp = self.apiCall("getuserinfo", user=user)
+ if resp.startswith("."):
+ self.core.debug("HotfileCom API Error: %s" % resp)
+ raise Exception
+ info = {}
+ for p in resp.split("&"):
+ key, value = p.split("=")
+ info[key] = value
+
+ info["premium_until"] = info["premium_until"].replace("T"," ")
+ zone = info["premium_until"][19:]
+ info["premium_until"] = info["premium_until"][:19]
+ zone = int(zone[:3])
+
+ validuntil = int(mktime(strptime(info["premium_until"], "%Y-%m-%d %H:%M:%S"))) + (zone*3600)
+ out = Account.getAccountInfo(self, user)
+ tmp = {"validuntil":validuntil, "trafficleft":-1}
+ out.update(tmp)
+ return out
+ except:
+ return Account.getAccountInfo(user)
def apiCall(self, method, post={}, user=None):
if user: