summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2010-08-17 14:36:29 +0200
committerGravatar mkaay <mkaay@mkaay.de> 2010-08-17 14:36:29 +0200
commitc22c64c348e1fd52cc88177c4b5ff099a30a62bd (patch)
treeee5f9cf9f6f1a623dc3a44bad0737ad514efcf76
parenthotfile + freakshare fix (diff)
downloadpyload-c22c64c348e1fd52cc88177c4b5ff099a30a62bd.tar.xz
account update
-rw-r--r--module/plugins/Account.py9
-rw-r--r--module/plugins/accounts/RapidshareCom.py4
-rw-r--r--module/plugins/accounts/ShareonlineBiz.py5
-rw-r--r--module/plugins/accounts/UploadedTo.py2
4 files changed, 14 insertions, 6 deletions
diff --git a/module/plugins/Account.py b/module/plugins/Account.py
index af8b6ebe8..61101347d 100644
--- a/module/plugins/Account.py
+++ b/module/plugins/Account.py
@@ -57,12 +57,13 @@ class Account():
def getAccountInfo(self, name):
return {
- "validuntil": None,
+ "validuntil": None, # -1 for unlimited
"login": name,
- "password": self.accounts[name]["password"],
+ #"password": self.accounts[name]["password"], #@XXX: security
"options": self.accounts[name]["options"],
- "trafficleft": None,
- "type": self.__name__
+ "trafficleft": None, # -1 for unlimited
+ "maxtraffic": None,
+ "type": self.__name__,
}
def getAllAccounts(self):
diff --git a/module/plugins/accounts/RapidshareCom.py b/module/plugins/accounts/RapidshareCom.py
index 7f5fff84d..b656bb763 100644
--- a/module/plugins/accounts/RapidshareCom.py
+++ b/module/plugins/accounts/RapidshareCom.py
@@ -50,7 +50,9 @@ class RapidshareCom(Account):
info[k] = v
out = Account.getAccountInfo(self, user)
- tmp = {"validuntil":None, "login":str(info["accountid"]), "trafficleft":int(info["tskb"]), "type":self.__name__}
+ restkb = int(info["tskb"])
+ maxtraffic = int(info["rapids"])/14 * (5*1024*1024) + restkb
+ tmp = {"validuntil":int(info["billeduntil"]), "trafficleft":maxtraffic if int(info["autorefill"]) else restkb, "maxtraffic":maxtraffic}
out.update(tmp)
return out
diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py
index 69a8ddc0c..3d213557a 100644
--- a/module/plugins/accounts/ShareonlineBiz.py
+++ b/module/plugins/accounts/ShareonlineBiz.py
@@ -28,6 +28,11 @@ class ShareonlineBiz(Account):
__author_mail__ = ("mkaay@mkaay.de")
#@TODO: account info
+ def getAccountInfo(self, user):
+ out = Account.getAccountInfo(self, user)
+ tmp = {"validuntil":None, "trafficleft":-1}
+ out.update(tmp)
+ return out
def login(self, user, data):
req = self.core.requestFactory.getRequest(self.__name__, user)
diff --git a/module/plugins/accounts/UploadedTo.py b/module/plugins/accounts/UploadedTo.py
index 926f91255..764cc50be 100644
--- a/module/plugins/accounts/UploadedTo.py
+++ b/module/plugins/accounts/UploadedTo.py
@@ -44,7 +44,7 @@ class UploadedTo(Account):
traffic = int(self.parseTraffic(raw_traffic))
validuntil = int(mktime(strptime(raw_valid.strip(), "%d-%m-%Y %H:%M")))
out = Account.getAccountInfo(self, user)
- tmp = {"login":user, "validuntil":validuntil, "trafficleft":traffic, "type":self.__name__}
+ tmp = {"validuntil":validuntil, "trafficleft":traffic, "maxtraffic":100*1024*1024}
out.update(tmp)
return out
except: