summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/HellshareCz.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/accounts/HellshareCz.py')
-rw-r--r--module/plugins/accounts/HellshareCz.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/module/plugins/accounts/HellshareCz.py b/module/plugins/accounts/HellshareCz.py
index dff2fe394..e559b28e1 100644
--- a/module/plugins/accounts/HellshareCz.py
+++ b/module/plugins/accounts/HellshareCz.py
@@ -9,7 +9,7 @@ from module.plugins.Account import Account
class HellshareCz(Account):
__name__ = "HellshareCz"
__type__ = "account"
- __version__ = "0.15"
+ __version__ = "0.16"
__description__ = """Hellshare.cz account plugin"""
__license__ = "GPLv3"
@@ -52,25 +52,28 @@ class HellshareCz(Account):
def login(self, user, data, req):
- html = req.load('http://www.hellshare.com/')
+ html = req.load('http://www.hellshare.com/', decode=True)
if req.lastEffectiveURL != 'http://www.hellshare.com/':
#Switch to English
self.logDebug("Switch lang - URL: %s" % req.lastEffectiveURL)
+
json = req.load("%s?do=locRouter-show" % req.lastEffectiveURL)
hash = re.search(r"(\-\-[0-9a-f]+\-)", json).group(1)
+
self.logDebug("Switch lang - HASH: %s" % hash)
- html = req.load('http://www.hellshare.com/%s/' % hash)
+
+ html = req.load('http://www.hellshare.com/%s/' % hash, decode=True)
if re.search(self.CREDIT_LEFT_PATTERN, html):
self.logDebug("Already logged in")
return
- html = req.load('http://www.hellshare.com/login?do=loginForm-submit', post={
- "login": "Log in",
- "password": data['password'],
- "username": user,
- "perm_login": "on"
- })
+ html = req.load('http://www.hellshare.com/login?do=loginForm-submit',
+ post={"login": "Log in",
+ "password": data['password'],
+ "username": user,
+ "perm_login": "on"},
+ decode=True)
if "<p>You input a wrong user name or wrong password</p>" in html:
self.wrongPassword()