summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2010-05-07 17:50:26 +0200
committerGravatar mkaay <mkaay@mkaay.de> 2010-05-07 17:50:26 +0200
commit58f36fc058e6f566ecffc395f09419f34ece50a9 (patch)
tree65bdc68d6110fc371446c99685dabb18156a1f0d /module/plugins
parentUploadedTo account plugin (diff)
downloadpyload-58f36fc058e6f566ecffc395f09419f34ece50a9.tar.xz
new server method for premium accounts
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/Account.py8
-rw-r--r--module/plugins/accounts/RapidshareCom.py2
-rw-r--r--module/plugins/accounts/UploadedTo.py2
3 files changed, 8 insertions, 4 deletions
diff --git a/module/plugins/Account.py b/module/plugins/Account.py
index 2ed2325c9..7c8beec76 100644
--- a/module/plugins/Account.py
+++ b/module/plugins/Account.py
@@ -43,10 +43,14 @@ class Account():
def getAccountInfo(self, name):
return {
"validuntil": None,
- "login": None,
- "trafficleft": None
+ "login": name,
+ "trafficleft": None,
+ "type": self.__name__
}
+ def getAllAccounts(self):
+ return map(lambda t: self.getAccountInfo(t[0]), self.accounts)
+
def getAccountRequest(self, plugin):
account = self.getAccountData(plugin)
req = self.core.requestFactory.getRequest(self.__name__, account[0])
diff --git a/module/plugins/accounts/RapidshareCom.py b/module/plugins/accounts/RapidshareCom.py
index c9113afd7..f494b17be 100644
--- a/module/plugins/accounts/RapidshareCom.py
+++ b/module/plugins/accounts/RapidshareCom.py
@@ -47,7 +47,7 @@ class RapidshareCom(Account):
continue
k, v = t.split("=")
info[k] = v
- out = {"validuntil":int(info["validuntil"]), "login":str(info["accountid"]), "trafficleft":int(info["premkbleft"])}
+ 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:
diff --git a/module/plugins/accounts/UploadedTo.py b/module/plugins/accounts/UploadedTo.py
index 9c0d90747..a56082657 100644
--- a/module/plugins/accounts/UploadedTo.py
+++ b/module/plugins/accounts/UploadedTo.py
@@ -42,7 +42,7 @@ class UploadedTo(Account):
raw_valid = re.search(r"Valid until: </span> <span class=.*?>(.*?)</span>", html).group(1)
traffic = int(self.parseTraffic(raw_traffic))
validuntil = int(mktime(strptime(raw_valid.strip(), "%d-%m-%Y %H:%M")))
- return {"login":name, "validuntil":validuntil, "trafficleft":traffic}
+ return {"login":name, "validuntil":validuntil, "trafficleft":traffic, "type":self.__name__}
def login(self):
for account in self.accounts: