summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2010-06-30 17:23:57 +0200
committerGravatar mkaay <mkaay@mkaay.de> 2010-06-30 17:23:57 +0200
commitaee4d8d8907c2973019277c5e9a011d82181f95b (patch)
treeb6dea70c51a81f7f95123084569ccad71500ad9e /module/plugins/accounts
parentYouPorn name fix (diff)
downloadpyload-aee4d8d8907c2973019277c5e9a011d82181f95b.tar.xz
RapidshareCom premium fix
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r--module/plugins/accounts/RapidshareCom.py24
1 files changed, 17 insertions, 7 deletions
diff --git a/module/plugins/accounts/RapidshareCom.py b/module/plugins/accounts/RapidshareCom.py
index f494b17be..016c084c9 100644
--- a/module/plugins/accounts/RapidshareCom.py
+++ b/module/plugins/accounts/RapidshareCom.py
@@ -36,7 +36,7 @@ class RapidshareCom(Account):
if not data:
return
api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi"
- api_param_prem = {"sub": "getaccountdetails_v1", "type": "prem", "login": data[0], "password": data[1]}
+ api_param_prem = {"sub": "getaccountdetails_v1", "type": "prem", "login": data[0], "password": data[1], "withcookie": 1}
src = req.load(api_url_base, cookies=False, get=api_param_prem)
if src.startswith("ERROR"):
return
@@ -47,16 +47,26 @@ class RapidshareCom(Account):
continue
k, v = t.split("=")
info[k] = v
- out = {"validuntil":int(info["validuntil"]), "login":str(info["accountid"]), "trafficleft":int(info["premkbleft"]), "type":self.__name__}
- if int(info["plustrafficmode"]) == 1 or int(info["plustrafficmode"]) == 3:
- out["trafficleft"] += int(info["bodkb"])
- if int(info["plustrafficmode"]) == 2 or int(info["plustrafficmode"]) == 3:
- out["trafficleft"] += 15*1024*int(info["ppoints"])
+ out = {"validuntil":None, "login":str(info["accountid"]), "trafficleft":int(info["tskb"]), "type":self.__name__}
+
return out
def login(self):
for account in self.accounts:
req = self.core.requestFactory.getRequest(self.__name__, account[0])
- html = req.load("https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi", post={"login":account[0], "password":account[1], "uselandingpage":1}, cookies=True)
+ api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi"
+ api_param_prem = {"sub": "getaccountdetails_v1", "type": "prem", "login": account[0], "password": account[1], "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
+ cj = self.core.requestFactory.getCookieJar(self.__name__, account[0])
+ cj.setCookie("rapidshare.com", "enc", info["cookie"])