From 48c0c42fd6faffc56432d5f037cd575979f180cc Mon Sep 17 00:00:00 2001 From: Walter Purcaro 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