summaryrefslogtreecommitdiffstats
path: root/pyload/plugin/account
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-13 17:20:59 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-13 17:20:59 +0200
commite00ef98491f79ae8aa972ae1473dae4a7b78c07e (patch)
tree31be0c7cdcebb61525bcc387bcf15d265a1c494a /pyload/plugin/account
parentFix except (diff)
downloadpyload-e00ef98491f79ae8aa972ae1473dae4a7b78c07e.tar.xz
Cleanup
Diffstat (limited to 'pyload/plugin/account')
-rw-r--r--pyload/plugin/account/NoPremiumPl.py4
-rw-r--r--pyload/plugin/account/OboomCom.py2
-rw-r--r--pyload/plugin/account/PremiumTo.py1
-rw-r--r--pyload/plugin/account/RapideoPl.py4
-rw-r--r--pyload/plugin/account/SmoozedCom.py2
5 files changed, 12 insertions, 1 deletions
diff --git a/pyload/plugin/account/NoPremiumPl.py b/pyload/plugin/account/NoPremiumPl.py
index cbbc937b5..ac0e64cd4 100644
--- a/pyload/plugin/account/NoPremiumPl.py
+++ b/pyload/plugin/account/NoPremiumPl.py
@@ -31,6 +31,7 @@ class NoPremiumPl(Account):
_usr = None
_pwd = None
+
def loadAccountInfo(self, name, req):
self._req = req
try:
@@ -53,6 +54,7 @@ class NoPremiumPl(Account):
"premium": premium
})
+
def login(self, user, data, req):
self._usr = user
self._pwd = hashlib.sha1(hashlib.md5(data["password"]).hexdigest()).hexdigest()
@@ -68,6 +70,7 @@ class NoPremiumPl(Account):
data['usr'] = self._usr
data['pwd'] = self._pwd
+
def createAuthQuery(self):
query = self._api_query
query["username"] = self._usr
@@ -75,6 +78,7 @@ class NoPremiumPl(Account):
return query
+
def runAuthQuery(self):
data = self._req.load(self._api_url, post=self.createAuthQuery())
diff --git a/pyload/plugin/account/OboomCom.py b/pyload/plugin/account/OboomCom.py
index 17239bda2..17d81428c 100644
--- a/pyload/plugin/account/OboomCom.py
+++ b/pyload/plugin/account/OboomCom.py
@@ -9,11 +9,13 @@ except ImportError:
from beaker.crypto.pbkdf2 import pbkdf2
from binascii import b2a_hex
class PBKDF2(object):
+
def __init__(self, passphrase, salt, iterations=1000):
self.passphrase = passphrase
self.salt = salt
self.iterations = iterations
+
def hexread(self, octets):
return b2a_hex(pbkdf2(self.passphrase, self.salt, self.iterations, octets))
diff --git a/pyload/plugin/account/PremiumTo.py b/pyload/plugin/account/PremiumTo.py
index 01369554f..fcd856ea7 100644
--- a/pyload/plugin/account/PremiumTo.py
+++ b/pyload/plugin/account/PremiumTo.py
@@ -15,7 +15,6 @@ class PremiumTo(Account):
("stickell", "l.stickell@yahoo.it")]
-
def loadAccountInfo(self, user, req):
traffic = req.load("http://premium.to/api/straffic.php",
get={'username': self.username, 'password': self.password})
diff --git a/pyload/plugin/account/RapideoPl.py b/pyload/plugin/account/RapideoPl.py
index dddb22781..d40c76cb5 100644
--- a/pyload/plugin/account/RapideoPl.py
+++ b/pyload/plugin/account/RapideoPl.py
@@ -31,6 +31,7 @@ class RapideoPl(Account):
_usr = None
_pwd = None
+
def loadAccountInfo(self, name, req):
self._req = req
try:
@@ -53,6 +54,7 @@ class RapideoPl(Account):
"premium": premium
})
+
def login(self, user, data, req):
self._usr = user
self._pwd = hashlib.md5(data["password"]).hexdigest()
@@ -67,6 +69,7 @@ class RapideoPl(Account):
data['usr'] = self._usr
data['pwd'] = self._pwd
+
def createAuthQuery(self):
query = self._api_query
query["username"] = self._usr
@@ -74,6 +77,7 @@ class RapideoPl(Account):
return query
+
def runAuthQuery(self):
data = self._req.load(self._api_url, post=self.createAuthQuery())
diff --git a/pyload/plugin/account/SmoozedCom.py b/pyload/plugin/account/SmoozedCom.py
index 3d0756021..7f4beb7d9 100644
--- a/pyload/plugin/account/SmoozedCom.py
+++ b/pyload/plugin/account/SmoozedCom.py
@@ -10,11 +10,13 @@ except ImportError:
from beaker.crypto.pbkdf2 import pbkdf2
from binascii import b2a_hex
class PBKDF2(object):
+
def __init__(self, passphrase, salt, iterations=1000):
self.passphrase = passphrase
self.salt = salt
self.iterations = iterations
+
def hexread(self, octets):
return b2a_hex(pbkdf2(self.passphrase, self.salt, self.iterations, octets))