diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-12 19:42:46 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-12 19:42:46 +0200 |
commit | e655d860882fff63160098f063fc3e4c9b8c0ba5 (patch) | |
tree | e05cbf8628841a64952d294663bd263c19d2bbcd /module/plugins/accounts/RapidshareCom.py | |
parent | merge (diff) | |
download | pyload-e655d860882fff63160098f063fc3e4c9b8c0ba5.tar.xz |
web if acc settings
Diffstat (limited to 'module/plugins/accounts/RapidshareCom.py')
-rw-r--r-- | module/plugins/accounts/RapidshareCom.py | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/module/plugins/accounts/RapidshareCom.py b/module/plugins/accounts/RapidshareCom.py index 052470ada..7f5fff84d 100644 --- a/module/plugins/accounts/RapidshareCom.py +++ b/module/plugins/accounts/RapidshareCom.py @@ -28,31 +28,34 @@ class RapidshareCom(Account): __author_mail__ = ("mkaay@mkaay.de") def getAccountInfo(self, user): - data = None - for account in self.accounts.items(): - if account[0] == user: - data = account[1] - if not data: - return - req = self.core.requestFactory.getRequest(self.__name__, user) - api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi" - api_param_prem = {"sub": "getaccountdetails_v1", "type": "prem", "login": user, "password": data["password"], "withcookie": 1} - src = req.load(api_url_base, cookies=False, get=api_param_prem) - if src.startswith("ERROR"): - return - fields = src.split("\n") - info = {} - for t in fields: - if not t.strip(): - continue - k, v = t.split("=") - info[k] = v + try: + data = None + for account in self.accounts.items(): + if account[0] == user: + data = account[1] + if not data: + return + req = self.core.requestFactory.getRequest(self.__name__, user) + api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi" + api_param_prem = {"sub": "getaccountdetails_v1", "type": "prem", "login": user, "password": data["password"], "withcookie": 1} + src = req.load(api_url_base, cookies=False, get=api_param_prem) + if src.startswith("ERROR"): + return + fields = src.split("\n") + info = {} + for t in fields: + if not t.strip(): + continue + k, v = t.split("=") + info[k] = v + + out = Account.getAccountInfo(self, user) + tmp = {"validuntil":None, "login":str(info["accountid"]), "trafficleft":int(info["tskb"]), "type":self.__name__} + out.update(tmp) - out = Account.getAccountInfo(self, user) - tmp = {"validuntil":None, "login":str(info["accountid"]), "trafficleft":int(info["tskb"]), "type":self.__name__} - out.update(tmp) - - return out + return out + except: + return Account.getAccountInfo(self, user) def login(self, user, data): req = self.core.requestFactory.getRequest(self.__name__, user) |