diff options
author | jansohn <jansohn@users.noreply.github.com> | 2015-10-02 10:09:26 +0200 |
---|---|---|
committer | jansohn <jansohn@users.noreply.github.com> | 2015-10-02 10:09:26 +0200 |
commit | 3a08656c5665f4b8db98744fb323e64b8630e084 (patch) | |
tree | 28f9f62ffc57888b76ca32540dbf5af3a4cfc8d0 /module/plugins/accounts/FshareVn.py | |
parent | Merge pull request #1 from pyload/stable (diff) | |
parent | [Account] Improve parse_traffic method + code cosmetics (diff) | |
download | pyload-3a08656c5665f4b8db98744fb323e64b8630e084.tar.xz |
Merge pull request #2 from pyload/stable
sync with stable
Diffstat (limited to 'module/plugins/accounts/FshareVn.py')
-rw-r--r-- | module/plugins/accounts/FshareVn.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py index bc8ced5e2..e692394ef 100644 --- a/module/plugins/accounts/FshareVn.py +++ b/module/plugins/accounts/FshareVn.py @@ -9,7 +9,7 @@ from module.plugins.internal.Account import Account class FshareVn(Account): __name__ = "FshareVn" __type__ = "account" - __version__ = "0.11" + __version__ = "0.14" __status__ = "testing" __description__ = """Fshare.vn account plugin""" @@ -24,7 +24,7 @@ class FshareVn(Account): DIRECT_DOWNLOAD_PATTERN = ur'<input type="checkbox"\s*([^=>]*)[^>]*/>Kích hoạt download trực tiếp</dt>' - def parse_info(self, user, password, data, req): + def grab_info(self, user, password, data): html = self.load("http://www.fshare.vn/account_info.php") if re.search(self.LIFETIME_PATTERN, html): @@ -33,7 +33,7 @@ class FshareVn(Account): return {'validuntil': -1, 'trafficleft': trafficleft, 'premium': True} m = re.search(self.VALID_UNTIL_PATTERN, html) - if m: + if m is not None: premium = True validuntil = time.mktime(time.strptime(m.group(1), '%I:%M:%S %p %d-%m-%Y')) trafficleft = self.get_traffic_left() @@ -45,7 +45,7 @@ class FshareVn(Account): return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} - def login(self, user, password, data, req): + def signin(self, user, password, data): html = self.load("https://www.fshare.vn/login.php", post={'LoginForm[email]' : user, 'LoginForm[password]' : password, @@ -53,9 +53,9 @@ class FshareVn(Account): 'yt0' : "Login"}) if not re.search(r'<img\s+alt="VIP"', html): - self.login_fail() + self.fail_login() def get_traffic_left(self): m = re.search(self.TRAFFIC_LEFT_PATTERN, html) - return self.parse_traffic(m.group(1) + m.group(2)) if m else 0 + return self.parse_traffic(m.group(1), m.group(2)) if m else 0 |