diff options
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r-- | module/plugins/accounts/FilefactoryCom.py | 5 | ||||
-rw-r--r-- | module/plugins/accounts/LinksnappyCom.py | 6 | ||||
-rw-r--r-- | module/plugins/accounts/OboomCom.py | 3 | ||||
-rw-r--r-- | module/plugins/accounts/OneFichierCom.py | 5 | ||||
-rw-r--r-- | module/plugins/accounts/SmoozedCom.py | 1 | ||||
-rw-r--r-- | module/plugins/accounts/UlozTo.py | 5 | ||||
-rw-r--r-- | module/plugins/accounts/WebshareCz.py | 6 |
7 files changed, 14 insertions, 17 deletions
diff --git a/module/plugins/accounts/FilefactoryCom.py b/module/plugins/accounts/FilefactoryCom.py index f07f4895a..37b6f97a8 100644 --- a/module/plugins/accounts/FilefactoryCom.py +++ b/module/plugins/accounts/FilefactoryCom.py @@ -1,10 +1,9 @@ # -*- coding: utf-8 -*- +import pycurl import re import time -from pycurl import REFERER - from module.plugins.Account import Account @@ -38,7 +37,7 @@ class FilefactoryCom(Account): def login(self, user, data, req): - req.http.c.setopt(REFERER, "http://www.filefactory.com/member/login.php") + req.http.c.setopt(pycurl.REFERER, "http://www.filefactory.com/member/login.php") html = req.load("http://www.filefactory.com/member/signin.php", post={"loginEmail" : user, diff --git a/module/plugins/accounts/LinksnappyCom.py b/module/plugins/accounts/LinksnappyCom.py index 97e368285..34571d374 100644 --- a/module/plugins/accounts/LinksnappyCom.py +++ b/module/plugins/accounts/LinksnappyCom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from hashlib import md5 +import hashlib from module.plugins.Account import Account from module.common.json_layer import json_loads @@ -18,7 +18,7 @@ class LinksnappyCom(Account): def loadAccountInfo(self, user, req): data = self.getAccountData(user) r = req.load('http://gen.linksnappy.com/lseAPI.php', - get={'act': 'USERDETAILS', 'username': user, 'password': md5(data['password']).hexdigest()}) + get={'act': 'USERDETAILS', 'username': user, 'password': hashlib.md5(data['password']).hexdigest()}) self.logDebug("JSON data: " + r) @@ -50,7 +50,7 @@ class LinksnappyCom(Account): r = req.load("http://gen.linksnappy.com/lseAPI.php", get={'act' : 'USERDETAILS', 'username': user, - 'password': md5(data['password']).hexdigest()}, + 'password': hashlib.md5(data['password']).hexdigest()}, decode=True) if 'Invalid Account Details' in r: diff --git a/module/plugins/accounts/OboomCom.py b/module/plugins/accounts/OboomCom.py index a9068f1df..020a45ba7 100644 --- a/module/plugins/accounts/OboomCom.py +++ b/module/plugins/accounts/OboomCom.py @@ -1,13 +1,12 @@ # -*- coding: utf-8 -*- -import time - try: from beaker.crypto.pbkdf2 import PBKDF2 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 diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py index be4b5e67e..b19e2bc69 100644 --- a/module/plugins/accounts/OneFichierCom.py +++ b/module/plugins/accounts/OneFichierCom.py @@ -1,10 +1,9 @@ # -*- coding: utf-8 -*- +import pycurl import re import time -from pycurl import REFERER - from module.plugins.Account import Account @@ -45,7 +44,7 @@ class OneFichierCom(Account): def login(self, user, data, req): - req.http.c.setopt(REFERER, "https://1fichier.com/login.pl?lg=en") + req.http.c.setopt(pycurl.REFERER, "https://1fichier.com/login.pl?lg=en") html = req.load("https://1fichier.com/login.pl?lg=en", post={'mail' : user, diff --git a/module/plugins/accounts/SmoozedCom.py b/module/plugins/accounts/SmoozedCom.py index 3c8226704..56cd1864a 100644 --- a/module/plugins/accounts/SmoozedCom.py +++ b/module/plugins/accounts/SmoozedCom.py @@ -9,6 +9,7 @@ try: 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 diff --git a/module/plugins/accounts/UlozTo.py b/module/plugins/accounts/UlozTo.py index 6ddb34385..f95c8834b 100644 --- a/module/plugins/accounts/UlozTo.py +++ b/module/plugins/accounts/UlozTo.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from urlparse import urljoin +import urlparse from module.plugins.Account import Account @@ -37,7 +36,7 @@ class UlozTo(Account): action = re.findall('<form action="(.+?)"', login_page)[1].replace('&', '&') token = re.search('_token_" value="(.+?)"', login_page).group(1) - html = req.load(urljoin("http://www.ulozto.net/", action), + html = req.load(urlparse.urljoin("http://www.ulozto.net/", action), post={'_token_' : token, 'do' : "loginForm-submit", 'login' : u"Přihlásit", diff --git a/module/plugins/accounts/WebshareCz.py b/module/plugins/accounts/WebshareCz.py index 3c5f45d34..f032e2317 100644 --- a/module/plugins/accounts/WebshareCz.py +++ b/module/plugins/accounts/WebshareCz.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- +import hashlib import re import time -from hashlib import md5, sha1 from passlib.hash import md5_crypt from module.plugins.Account import Account @@ -51,8 +51,8 @@ class WebshareCz(Account): self.wrongPassword() salt = re.search('<salt>(.+)</salt>', salt).group(1) - password = sha1(md5_crypt.encrypt(data["password"], salt=salt)).hexdigest() - digest = md5(user + ":Webshare:" + password).hexdigest() + password = hashlib.sha1(md5_crypt.encrypt(data["password"], salt=salt)).hexdigest() + digest = hashlib.md5(user + ":Webshare:" + password).hexdigest() login = req.load("https://webshare.cz/api/login/", post={'digest' : digest, |