From 3dec02dd4cf0346f840ef2f859bfe7a00f0b448d Mon Sep 17 00:00:00 2001 From: Stefano Date: Thu, 26 Jun 2014 13:35:29 +0200 Subject: [Fshare] Fixed #651 --- module/plugins/accounts/FshareVn.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/accounts/FshareVn.py') diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py index cb2ad700c..61122b996 100644 --- a/module/plugins/accounts/FshareVn.py +++ b/module/plugins/accounts/FshareVn.py @@ -26,7 +26,7 @@ from module.plugins.Account import Account class FshareVn(Account): __name__ = "FshareVn" - __version__ = "0.06" + __version__ = "0.07" __type__ = "account" __description__ = """Fshare.vn account plugin""" __author_name__ = ("zoidberg", "stickell") @@ -63,10 +63,10 @@ class FshareVn(Account): self.html = req.load('https://www.fshare.vn/login.php', post={ "login_password": data['password'], "login_useremail": user, - "url_refe": "https://www.fshare.vn/login.php" + "url_refe": "http://www.fshare.vn/index.php" }, referer=True, decode=True) - if not 'VIP Date: Mon, 14 Jul 2014 02:23:37 +0200 Subject: Removed all @author flags + key attributes cleanup for internal & hooks plugins --- module/plugins/accounts/FshareVn.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/accounts/FshareVn.py') diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py index 61122b996..c6f30c88e 100644 --- a/module/plugins/accounts/FshareVn.py +++ b/module/plugins/accounts/FshareVn.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: zoidberg """ from time import mktime, strptime -- cgit v1.2.3 From 8e47b0de30a25d0fd5dfb518bfe4e1e7beff93fd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 16:27:44 +0200 Subject: Key attributes cleanup for account, container and crypter plugins --- module/plugins/accounts/FshareVn.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/plugins/accounts/FshareVn.py') diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py index c6f30c88e..27b74c907 100644 --- a/module/plugins/accounts/FshareVn.py +++ b/module/plugins/accounts/FshareVn.py @@ -26,6 +26,7 @@ class FshareVn(Account): __name__ = "FshareVn" __version__ = "0.07" __type__ = "account" + __description__ = """Fshare.vn account plugin""" __author_name__ = ("zoidberg", "stickell") __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") @@ -35,6 +36,7 @@ class FshareVn(Account): TRAFFIC_LEFT_PATTERN = ur'
Tổng Dung Lượng Tài Khoản
\s*]*>([0-9.]+) ([kKMG])B' DIRECT_DOWNLOAD_PATTERN = ur']*)[^>]*/>Kích hoạt download trực tiếp' + def loadAccountInfo(self, user, req): self.html = req.load("http://www.fshare.vn/account_info.php", decode=True) -- cgit v1.2.3 From 9762ac2fe94e3c6709fc46b6e9bde99e10cb3681 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 02:25:53 +0200 Subject: [account] self.html -> html (where was possible) --- module/plugins/accounts/FshareVn.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/accounts/FshareVn.py') diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py index 27b74c907..3996322ad 100644 --- a/module/plugins/accounts/FshareVn.py +++ b/module/plugins/accounts/FshareVn.py @@ -38,14 +38,14 @@ class FshareVn(Account): def loadAccountInfo(self, user, req): - self.html = req.load("http://www.fshare.vn/account_info.php", decode=True) + html = req.load("http://www.fshare.vn/account_info.php", decode=True) - if re.search(self.LIFETIME_PATTERN, self.html): + if re.search(self.LIFETIME_PATTERN, html): self.logDebug("Lifetime membership detected") trafficleft = self.getTrafficLeft() return {"validuntil": -1, "trafficleft": trafficleft, "premium": True} - found = re.search(self.VALID_UNTIL_PATTERN, self.html) + found = re.search(self.VALID_UNTIL_PATTERN, html) if found: premium = True validuntil = mktime(strptime(found.group(1), '%I:%M:%S %p %d-%m-%Y')) @@ -60,15 +60,15 @@ class FshareVn(Account): def login(self, user, data, req): req.http.c.setopt(REFERER, "https://www.fshare.vn/login.php") - self.html = req.load('https://www.fshare.vn/login.php', post={ + 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) - if not re.search(r' Date: Sun, 20 Jul 2014 03:02:09 +0200 Subject: Store all re.search/match object as "m" instead "found" --- module/plugins/accounts/FshareVn.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/accounts/FshareVn.py') diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py index 3996322ad..5726ad410 100644 --- a/module/plugins/accounts/FshareVn.py +++ b/module/plugins/accounts/FshareVn.py @@ -45,10 +45,10 @@ class FshareVn(Account): trafficleft = self.getTrafficLeft() return {"validuntil": -1, "trafficleft": trafficleft, "premium": True} - found = re.search(self.VALID_UNTIL_PATTERN, html) - if found: + m = re.search(self.VALID_UNTIL_PATTERN, html) + if m: premium = True - validuntil = mktime(strptime(found.group(1), '%I:%M:%S %p %d-%m-%Y')) + validuntil = mktime(strptime(m.group(1), '%I:%M:%S %p %d-%m-%Y')) trafficleft = self.getTrafficLeft() else: premium = False @@ -70,5 +70,5 @@ class FshareVn(Account): self.wrongPassword() def getTrafficLeft(self): - found = re.search(self.TRAFFIC_LEFT_PATTERN, html) - return float(found.group(1)) * 1024 ** {'k': 0, 'K': 0, 'M': 1, 'G': 2}[found.group(2)] if found else 0 + 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 -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/accounts/FshareVn.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'module/plugins/accounts/FshareVn.py') diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py index 5726ad410..78714f238 100644 --- a/module/plugins/accounts/FshareVn.py +++ b/module/plugins/accounts/FshareVn.py @@ -1,20 +1,5 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" - from time import mktime, strptime from pycurl import REFERER import re @@ -24,8 +9,8 @@ from module.plugins.Account import Account class FshareVn(Account): __name__ = "FshareVn" - __version__ = "0.07" __type__ = "account" + __version__ = "0.07" __description__ = """Fshare.vn account plugin""" __author_name__ = ("zoidberg", "stickell") -- cgit v1.2.3 From b0868ae6446078bacf1635dde5e4ab316b4a94cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Oct 2014 18:57:59 +0200 Subject: New __authors__ key replaces __author_name__ and __author_mail__ + Whitespaces and EOF fixup --- module/plugins/accounts/FshareVn.py | 5 +++-- 1 file changed, 3 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 78714f238..9e3521a5f 100644 --- a/module/plugins/accounts/FshareVn.py +++ b/module/plugins/accounts/FshareVn.py @@ -13,8 +13,9 @@ class FshareVn(Account): __version__ = "0.07" __description__ = """Fshare.vn account plugin""" - __author_name__ = ("zoidberg", "stickell") - __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") + __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), + ("stickell", "l.stickell@yahoo.it")] + VALID_UNTIL_PATTERN = ur'
Thời hạn dùng:
\s*
([^<]+)
' LIFETIME_PATTERN = ur'
Lần đăng nhập trước:
\s*
[^<]+
' -- cgit v1.2.3 From ae7a7e66981456e5bbe2b54006d79b6f907be7a4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- module/plugins/accounts/FshareVn.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/FshareVn.py') diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py index 9e3521a5f..11ad736f6 100644 --- a/module/plugins/accounts/FshareVn.py +++ b/module/plugins/accounts/FshareVn.py @@ -13,6 +13,7 @@ class FshareVn(Account): __version__ = "0.07" __description__ = """Fshare.vn account plugin""" + __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), ("stickell", "l.stickell@yahoo.it")] -- cgit v1.2.3 From f76e5c2336718dca9da8033ba22cd83c72c7b3b3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:14:28 +0200 Subject: Pattern update 1 --- module/plugins/accounts/FshareVn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/FshareVn.py') diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py index 11ad736f6..b208743e0 100644 --- a/module/plugins/accounts/FshareVn.py +++ b/module/plugins/accounts/FshareVn.py @@ -20,7 +20,7 @@ class FshareVn(Account): VALID_UNTIL_PATTERN = ur'
Thời hạn dùng:
\s*
([^<]+)
' LIFETIME_PATTERN = ur'
Lần đăng nhập trước:
\s*
[^<]+
' - TRAFFIC_LEFT_PATTERN = ur'
Tổng Dung Lượng Tài Khoản
\s*]*>([0-9.]+) ([kKMG])B' + TRAFFIC_LEFT_PATTERN = ur'
Tổng Dung Lượng Tài Khoản
\s*]*>([\d.]+) ([kKMG])B' DIRECT_DOWNLOAD_PATTERN = ur']*)[^>]*/>Kích hoạt download trực tiếp' -- cgit v1.2.3 From 6a0fb7fdd4ea2749be44625225d8a235a78f032f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:42:39 +0200 Subject: [accounts] Code cosmetics --- module/plugins/accounts/FshareVn.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/FshareVn.py') diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py index b208743e0..45ee5a749 100644 --- a/module/plugins/accounts/FshareVn.py +++ b/module/plugins/accounts/FshareVn.py @@ -44,6 +44,7 @@ class FshareVn(Account): return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium} + def login(self, user, data, req): req.http.c.setopt(REFERER, "https://www.fshare.vn/login.php") -- cgit v1.2.3 From 0eb6e7ec4a1144dcca824d8add049787d3da1762 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 22 Oct 2014 19:44:59 +0200 Subject: Two space before function declaration --- module/plugins/accounts/FshareVn.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/FshareVn.py') diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py index 45ee5a749..9e513d6f6 100644 --- a/module/plugins/accounts/FshareVn.py +++ b/module/plugins/accounts/FshareVn.py @@ -57,6 +57,7 @@ class FshareVn(Account): if not re.search(r' Date: Tue, 28 Oct 2014 16:52:10 +0100 Subject: Code cosmetics: plugin class attributes --- module/plugins/accounts/FshareVn.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/accounts/FshareVn.py') diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py index 9e513d6f6..d1b05209c 100644 --- a/module/plugins/accounts/FshareVn.py +++ b/module/plugins/accounts/FshareVn.py @@ -8,14 +8,14 @@ from module.plugins.Account import Account class FshareVn(Account): - __name__ = "FshareVn" - __type__ = "account" + __name__ = "FshareVn" + __type__ = "account" __version__ = "0.07" __description__ = """Fshare.vn account plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), - ("stickell", "l.stickell@yahoo.it")] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), + ("stickell", "l.stickell@yahoo.it")] VALID_UNTIL_PATTERN = ur'
Thời hạn dùng:
\s*
([^<]+)
' -- cgit v1.2.3 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