summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar Pedro Algarvio <pedro@algarvio.me> 2012-01-18 08:16:02 +0100
committerGravatar Pedro Algarvio <pedro@algarvio.me> 2012-01-18 08:16:02 +0100
commit8d7171144bb4cca26797ee8dcfc2a3af25eaceca (patch)
treed9864ccde633735edbef1f4bf52909437557f7e0 /module
parentAlso fix `login` on the Oron Account plugin. (diff)
downloadpyload-8d7171144bb4cca26797ee8dcfc2a3af25eaceca.tar.xz
Fix FileSonic and Oron account plugins deprecated method signatures.
Diffstat (limited to 'module')
-rw-r--r--module/plugins/accounts/FilesonicCom.py13
-rwxr-xr-xmodule/plugins/accounts/OronCom.py4
2 files changed, 9 insertions, 8 deletions
diff --git a/module/plugins/accounts/FilesonicCom.py b/module/plugins/accounts/FilesonicCom.py
index 1207f1b56..1b0104b2a 100644
--- a/module/plugins/accounts/FilesonicCom.py
+++ b/module/plugins/accounts/FilesonicCom.py
@@ -37,10 +37,10 @@ class FilesonicCom(Account):
decode=True)
return json_loads(xml)["FSApi_Utility"]["getFilesonicDomainForCurrentIp"]["response"]
- def loadAccountInfo(self, user, req):
+ def loadAccountInfo(self, req):
xml = req.load(self.API_URL + "/user?method=getInfo&format=json",
- post={"u": user,
- "p": self.accounts[user]["password"]}, decode=True)
+ post={"u": self.loginname,
+ "p": self.password}, decode=True)
self.logDebug("account status retrieved from api %s" % xml)
@@ -56,15 +56,16 @@ class FilesonicCom(Account):
validuntil = -1
return {"validuntil": validuntil, "trafficleft": -1, "premium": premium}
- def login(self, user, data, req):
+ def login(self, req):
domain = self.getDomain(req)
post_vars = {
- "email": user,
- "password": data["password"],
+ "email": self.loginname,
+ "password": self.password,
"rememberMe": 1
}
page = req.load("http://www%s/user/login" % domain, cookies=True, post=post_vars, decode=True)
if "Provided password does not match." in page or "You must be logged in to view this page." in page:
self.wrongPassword()
+
diff --git a/module/plugins/accounts/OronCom.py b/module/plugins/accounts/OronCom.py
index 2b4f8bdb3..1fe8a4449 100755
--- a/module/plugins/accounts/OronCom.py
+++ b/module/plugins/accounts/OronCom.py
@@ -47,9 +47,9 @@ class OronCom(Account):
tmp = {"validuntil": validuntil, "trafficleft": trafficleft, "premium" : premium}
return tmp
- def login(self, data, req):
+ def login(self, req):
req.load("http://oron.com/?op=change_lang&lang=german")
- page = req.load("http://oron.com/login", post={"login": self.loginname, "password": data["password"], "op": "login"})
+ page = req.load("http://oron.com/login", post={"login": self.loginname, "password": self.password, "op": "login"})
if r'<b class="err">Login oder Passwort falsch</b>' in page:
self.wrongPassword()