summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-05-25 20:37:32 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-05-25 20:37:32 +0200
commitefee017fb2b3a4cac09233cd01d816d9100a5db5 (patch)
tree58635208703ae98e2359e160860f7ea7af68445f /module/plugins/accounts
parentRealdebridCom plugin (diff)
downloadpyload-efee017fb2b3a4cac09233cd01d816d9100a5db5.tar.xz
rehost plugin, fixed some account management issues
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r--module/plugins/accounts/RehostTo.py37
-rw-r--r--module/plugins/accounts/UploadedTo.py2
2 files changed, 38 insertions, 1 deletions
diff --git a/module/plugins/accounts/RehostTo.py b/module/plugins/accounts/RehostTo.py
new file mode 100644
index 000000000..e1cb2668f
--- /dev/null
+++ b/module/plugins/accounts/RehostTo.py
@@ -0,0 +1,37 @@
+from module.plugins.Account import Account
+
+
+class RehostTo(Account):
+ __name__ = "RehostTo"
+ __version__ = "0.1"
+ __type__ = "account"
+ __description__ = """Rehost.to account plugin"""
+ __author_name__ = ("RaNaN")
+ __author_mail__ = ("RaNaN@pyload.org")
+
+
+ def loadAccountInfo(self, user, req):
+
+ data = self.getAccountData(user)
+ page = req.load("http://rehost.to/api.php?cmd=login&user=%s&pass=%s" % (user, data["password"]))
+ data = [x.split("=") for x in page.split(",")]
+ ses = data[0][1]
+ long_ses = data[1][1]
+
+ page = req.load("http://rehost.to/api.php?cmd=get_premium_credits&long_ses=%s" % long_ses)
+ traffic, valid = page.split(",")
+
+ account_info = {"trafficleft": int(traffic) * 1024,
+ "validuntil": int(valid),
+ "long_ses": long_ses,
+ "ses": ses}
+
+ return account_info
+
+ def login(self, user, data, req):
+ page = req.load("http://rehost.to/api.php?cmd=login&user=%s&pass=%s" % (user, data["password"]))
+
+ if "Login failed." in page:
+ self.wrongPassword()
+
+
diff --git a/module/plugins/accounts/UploadedTo.py b/module/plugins/accounts/UploadedTo.py
index 63092a3cb..5fcc77498 100644
--- a/module/plugins/accounts/UploadedTo.py
+++ b/module/plugins/accounts/UploadedTo.py
@@ -45,7 +45,7 @@ class UploadedTo(Account):
return {"validuntil":validuntil, "trafficleft":traffic, "maxtraffic":50*1024*1024}
else:
- return {"premium" : False}
+ return {"premium" : False, "validuntil" : -1}
def login(self, user, data, req):
page = req.load("http://uploaded.to/io/login", post={ "id" : user, "pw" : data["password"], "_" : ""})