From fb65d5354c3cc80c3f48c3a2745b8dc01105edfd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 18 Dec 2014 16:02:29 +0100 Subject: Update account plugins --- module/plugins/accounts/FshareVn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/FshareVn.py') diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py index d1b05209c..2da45aac6 100644 --- a/module/plugins/accounts/FshareVn.py +++ b/module/plugins/accounts/FshareVn.py @@ -10,7 +10,7 @@ from module.plugins.Account import Account class FshareVn(Account): __name__ = "FshareVn" __type__ = "account" - __version__ = "0.07" + __version__ = "0.08" __description__ = """Fshare.vn account plugin""" __license__ = "GPLv3" @@ -60,4 +60,4 @@ class FshareVn(Account): def getTrafficLeft(self): m = re.search(self.TRAFFIC_LEFT_PATTERN, html) - return float(m.group(1)) * 1024 ** {'k': 0, 'K': 0, 'M': 1, 'G': 2}[m.group(2)] if m else 0 + return self.parseTraffic(m.group(1) + m.group(2)) if m else 0 -- cgit v1.2.3 From 36e60a23497ae05736c24fed2f4ce936fb61f744 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 8 Jan 2015 23:31:33 +0100 Subject: "New Year" Update: account plugins --- module/plugins/accounts/FshareVn.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'module/plugins/accounts/FshareVn.py') diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py index 2da45aac6..66d912958 100644 --- a/module/plugins/accounts/FshareVn.py +++ b/module/plugins/accounts/FshareVn.py @@ -1,16 +1,16 @@ # -*- coding: utf-8 -*- -from time import mktime, strptime -from pycurl import REFERER import re +from time import mktime, strptime + from module.plugins.Account import Account class FshareVn(Account): __name__ = "FshareVn" __type__ = "account" - __version__ = "0.08" + __version__ = "0.09" __description__ = """Fshare.vn account plugin""" __license__ = "GPLv3" @@ -46,13 +46,13 @@ class FshareVn(Account): def login(self, user, data, req): - req.http.c.setopt(REFERER, "https://www.fshare.vn/login.php") - - html = req.load('https://www.fshare.vn/login.php', post={ - "login_password": data['password'], - "login_useremail": user, - "url_refe": "http://www.fshare.vn/index.php" - }, referer=True, decode=True) + html = req.load("https://www.fshare.vn/login.php", + post={'LoginForm[email]' : user, + 'LoginForm[password]' : data['password'], + 'LoginForm[rememberMe]': 1, + 'yt0' : "Login"}, + referer=True, + decode=True) if not re.search(r'