diff options
Diffstat (limited to 'module/plugins/accounts')
68 files changed, 373 insertions, 1075 deletions
diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index acfb6874a..dbf4ad800 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -1,27 +1,31 @@ # -*- coding: utf-8 -*- +import re import xml.dom.minidom as dom + from time import time -import re -import urllib +from urllib import urlencode -from module.plugins.Account import Account from BeautifulSoup import BeautifulSoup +from module.plugins.Account import Account + class AlldebridCom(Account): __name__ = "AlldebridCom" - __version__ = "0.22" __type__ = "account" + __version__ = "0.22" + __description__ = """AllDebrid.com account plugin""" __author_name__ = "Andy Voigt" __author_mail__ = "spamsales@online.de" + def loadAccountInfo(self, user, req): data = self.getAccountData(user) page = req.load("http://www.alldebrid.com/account/") soup = BeautifulSoup(page) - #Try to parse expiration date directly from the control panel page (better accuracy) + #Try to parse expiration date directly from the control panel page (better accuracy) try: time_text = soup.find('div', attrs={'class': 'remaining_time_text'}).strong.string self.logDebug("Account expires in: %s" % time_text) @@ -33,7 +37,7 @@ class AlldebridCom(Account): except: data = self.getAccountData(user) page = req.load("http://www.alldebrid.com/api.php?action=info_user&login=%s&pw=%s" % (user, - data["password"])) + data['password'])) self.logDebug(page) xml = dom.parseString(page) exp_time = time() + int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue) * 24 * 60 * 60 @@ -41,7 +45,7 @@ class AlldebridCom(Account): return account_info def login(self, user, data, req): - urlparams = urllib.urlencode({'action': 'login', 'login_login': user, 'login_password': data["password"]}) + urlparams = urlencode({'action': 'login', 'login_login': user, 'login_password': data['password']}) page = req.load("http://www.alldebrid.com/register/?%s" % urlparams) if "This login doesn't exist" in page: diff --git a/module/plugins/accounts/BayfilesCom.py b/module/plugins/accounts/BayfilesCom.py index bbd81e10b..7c4708f7d 100644 --- a/module/plugins/accounts/BayfilesCom.py +++ b/module/plugins/accounts/BayfilesCom.py @@ -1,22 +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 <http://www.gnu.org/licenses/>. - - @author: zoidberg -""" - from time import time from module.plugins.Account import Account @@ -25,27 +8,29 @@ from module.common.json_layer import json_loads class BayfilesCom(Account): __name__ = "BayfilesCom" - __version__ = "0.03" __type__ = "account" + __version__ = "0.03" + __description__ = """Bayfiles.com account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" + def loadAccountInfo(self, user, req): for _ in xrange(2): response = json_loads(req.load("http://api.bayfiles.com/v1/account/info")) self.logDebug(response) - if not response["error"]: + if not response['error']: break - self.logWarning(response["error"]) + self.logWarning(response['error']) self.relogin(user) return {"premium": bool(response['premium']), "trafficleft": -1, "validuntil": response['expires'] if response['expires'] >= int(time()) else -1} def login(self, user, data, req): - response = json_loads(req.load("http://api.bayfiles.com/v1/account/login/%s/%s" % (user, data["password"]))) + response = json_loads(req.load("http://api.bayfiles.com/v1/account/login/%s/%s" % (user, data['password']))) self.logDebug(response) - if response["error"]: - self.logError(response["error"]) + if response['error']: + self.logError(response['error']) self.wrongPassword() diff --git a/module/plugins/accounts/BitshareCom.py b/module/plugins/accounts/BitshareCom.py index 4fe01aa5b..272bbeb6e 100644 --- a/module/plugins/accounts/BitshareCom.py +++ b/module/plugins/accounts/BitshareCom.py @@ -1,32 +1,17 @@ # -*- 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 <http://www.gnu.org/licenses/>. - - @author: pking -""" - from module.plugins.Account import Account class BitshareCom(Account): __name__ = "BitshareCom" - __version__ = "0.12" __type__ = "account" + __version__ = "0.12" + __description__ = """Bitshare account plugin""" __author_name__ = "Paul King" - __author_mail__ = "" + __author_mail__ = None + def loadAccountInfo(self, user, req): page = req.load("http://bitshare.com/mysettings.html") @@ -41,6 +26,6 @@ class BitshareCom(Account): def login(self, user, data, req): page = req.load("http://bitshare.com/login.html", - post={"user": user, "password": data["password"], "submit": "Login"}, cookies=True) + post={"user": user, "password": data['password'], "submit": "Login"}, cookies=True) if "login" in req.lastEffectiveURL: self.wrongPassword() diff --git a/module/plugins/accounts/CramitIn.py b/module/plugins/accounts/CramitIn.py index 56cb5390b..34aa3ab40 100644 --- a/module/plugins/accounts/CramitIn.py +++ b/module/plugins/accounts/CramitIn.py @@ -5,8 +5,9 @@ from module.plugins.internal.XFSPAccount import XFSPAccount class CramitIn(XFSPAccount): __name__ = "CramitIn" - __version__ = "0.01" __type__ = "account" + __version__ = "0.01" + __description__ = """Cramit.in account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" diff --git a/module/plugins/accounts/CyberlockerCh.py b/module/plugins/accounts/CyberlockerCh.py index 4f3189b0c..729975fb0 100644 --- a/module/plugins/accounts/CyberlockerCh.py +++ b/module/plugins/accounts/CyberlockerCh.py @@ -6,14 +6,16 @@ from module.plugins.internal.SimpleHoster import parseHtmlForm class CyberlockerCh(XFSPAccount): __name__ = "CyberlockerCh" - __version__ = "0.01" __type__ = "account" + __version__ = "0.01" + __description__ = """Cyberlocker.ch account plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" MAIN_PAGE = "http://cyberlocker.ch/" + def login(self, user, data, req): html = req.load(self.MAIN_PAGE + 'login.html', decode=True) diff --git a/module/plugins/accounts/CzshareCom.py b/module/plugins/accounts/CzshareCom.py index bdd2000c9..6f2ee641e 100644 --- a/module/plugins/accounts/CzshareCom.py +++ b/module/plugins/accounts/CzshareCom.py @@ -1,22 +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 <http://www.gnu.org/licenses/>. - - @author: zoidberg -""" - from time import mktime, strptime import re @@ -25,30 +8,32 @@ from module.plugins.Account import Account class CzshareCom(Account): __name__ = "CzshareCom" - __version__ = "0.14" __type__ = "account" + __version__ = "0.14" + __description__ = """Czshare.com account plugin, now Sdilej.cz""" __author_name__ = ("zoidberg", "stickell") __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") CREDIT_LEFT_PATTERN = r'<tr class="active">\s*<td>([0-9 ,]+) (KiB|MiB|GiB)</td>\s*<td>([^<]*)</td>\s*</tr>' + def loadAccountInfo(self, user, req): html = req.load("http://sdilej.cz/prehled_kreditu/") - found = re.search(self.CREDIT_LEFT_PATTERN, html) - if not found: + m = re.search(self.CREDIT_LEFT_PATTERN, html) + if m is None: return {"validuntil": 0, "trafficleft": 0} else: - credits = float(found.group(1).replace(' ', '').replace(',', '.')) - credits = credits * 1024 ** {'KiB': 0, 'MiB': 1, 'GiB': 2}[found.group(2)] - validuntil = mktime(strptime(found.group(3), '%d.%m.%y %H:%M')) + credits = float(m.group(1).replace(' ', '').replace(',', '.')) + credits = credits * 1024 ** {'KiB': 0, 'MiB': 1, 'GiB': 2}[m.group(2)] + validuntil = mktime(strptime(m.group(3), '%d.%m.%y %H:%M')) return {"validuntil": validuntil, "trafficleft": credits} def login(self, user, data, req): html = req.load('https://sdilej.cz/index.php', post={ "Prihlasit": "Prihlasit", - "login-password": data["password"], + "login-password": data['password'], "login-name": user }) diff --git a/module/plugins/accounts/DdlstorageCom.py b/module/plugins/accounts/DdlstorageCom.py deleted file mode 100644 index f3eebc59b..000000000 --- a/module/plugins/accounts/DdlstorageCom.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- - -from hashlib import md5 -from time import mktime, strptime - -from module.plugins.internal.XFSPAccount import XFSPAccount -from module.common.json_layer import json_loads -from module.utils import parseFileSize - -# DDLStorage API Documentation: -# http://www.ddlstorage.com/cgi-bin/api_req.cgi?req_type=doc - - -class DdlstorageCom(XFSPAccount): - __name__ = "DdlstorageCom" - __version__ = "1.00" - __type__ = "account" - __description__ = """DDLStorage.com account plugin""" - __author_name__ = "stickell" - __author_mail__ = "l.stickell@yahoo.it" - - MAIN_PAGE = "http://ddlstorage.com/" - - def loadAccountInfo(self, user, req): - password = self.accounts[user]['password'] - api_data = req.load('http://www.ddlstorage.com/cgi-bin/api_req.cgi', - post={'req_type': 'user_info', - 'client_id': 53472, - 'user_login': user, - 'user_password': md5(password).hexdigest(), - 'sign': md5('user_info%d%s%s%s' % (53472, user, md5(password).hexdigest(), - '25JcpU2dPOKg8E2OEoRqMSRu068r0Cv3')).hexdigest()}) - api_data = api_data.replace('<pre>', '').replace('</pre>', '') - self.logDebug('Account Info API data: ' + api_data) - api_data = json_loads(api_data) - - if api_data['status'] != 'OK': # 'status' must be always OK for a working account - return {"premium": False, "valid": False} - - if api_data['account_type'] == 'REGISTERED': - premium = False - validuntil = None - else: - premium = True - validuntil = int(mktime(strptime(api_data['premium_expire'], "%Y-%m-%d %H:%M:%S"))) - - if api_data['usr_bandwidth_available'] == 'UNLIMITED': - trafficleft = -1 - else: - trafficleft = parseFileSize(api_data['usr_bandwidth_available']) / 1024 - - return {"premium": premium, "validuntil": validuntil, "trafficleft": trafficleft} diff --git a/module/plugins/accounts/DebridItaliaCom.py b/module/plugins/accounts/DebridItaliaCom.py index dd714102f..f4441c356 100644 --- a/module/plugins/accounts/DebridItaliaCom.py +++ b/module/plugins/accounts/DebridItaliaCom.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero 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 Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ import re import time @@ -22,14 +8,16 @@ from module.plugins.Account import Account class DebridItaliaCom(Account): __name__ = "DebridItaliaCom" - __version__ = "0.1" __type__ = "account" + __version__ = "0.1" + __description__ = """Debriditalia.com account plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" WALID_UNTIL_PATTERN = r"Premium valid till: (?P<D>[^|]+) \|" + def loadAccountInfo(self, user, req): if 'Account premium not activated' in self.html: return {"premium": False, "validuntil": None, "trafficleft": None} @@ -43,6 +31,6 @@ class DebridItaliaCom(Account): def login(self, user, data, req): self.html = req.load("http://debriditalia.com/login.php", - get={"u": user, "p": data["password"]}) + get={"u": user, "p": data['password']}) if 'NO' in self.html: self.wrongPassword() diff --git a/module/plugins/accounts/DepositfilesCom.py b/module/plugins/accounts/DepositfilesCom.py index 427f5c34d..01f1906f4 100644 --- a/module/plugins/accounts/DepositfilesCom.py +++ b/module/plugins/accounts/DepositfilesCom.py @@ -1,23 +1,7 @@ # -*- 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 <http://www.gnu.org/licenses/>. - - @author: mkaay -""" - import re + from time import strptime, mktime from module.plugins.Account import Account @@ -25,14 +9,16 @@ from module.plugins.Account import Account class DepositfilesCom(Account): __name__ = "DepositfilesCom" - __version__ = "0.2" __type__ = "account" + __version__ = "0.3" + __description__ = """Depositfiles.com account plugin""" - __author_name__ = ("mkaay", "stickell") - __author_mail__ = ("mkaay@mkaay.de", "l.stickell@yahoo.it") + __author_name__ = ("mkaay", "stickell", "Walter Purcaro") + __author_mail__ = ("mkaay@mkaay.de", "l.stickell@yahoo.it", "vuolter@gmail.com") + def loadAccountInfo(self, user, req): - src = req.load("http://depositfiles.com/de/gold/") + src = req.load("https://dfiles.eu/de/gold/") validuntil = re.search(r"Sie haben Gold Zugang bis: <b>(.*?)</b></div>", src).group(1) validuntil = int(mktime(strptime(validuntil, "%Y-%m-%d %H:%M:%S"))) @@ -40,8 +26,7 @@ class DepositfilesCom(Account): return {"validuntil": validuntil, "trafficleft": -1} def login(self, user, data, req): - req.load("http://depositfiles.com/de/gold/payment.php") - src = req.load("http://depositfiles.com/de/login.php", get={"return": "/de/gold/payment.php"}, - post={"login": user, "password": data["password"]}) + src = req.load("https://dfiles.eu/de/login.php", get={"return": "/de/gold/payment.php"}, + post={"login": user, "password": data['password']}) if r'<div class="error_message">Sie haben eine falsche Benutzername-Passwort-Kombination verwendet.</div>' in src: self.wrongPassword() diff --git a/module/plugins/accounts/EasybytezCom.py b/module/plugins/accounts/EasybytezCom.py index 16ce674e2..3b8517686 100644 --- a/module/plugins/accounts/EasybytezCom.py +++ b/module/plugins/accounts/EasybytezCom.py @@ -1,22 +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 <http://www.gnu.org/licenses/>. - - @author: zoidberg -""" - import re from time import mktime, strptime, gmtime @@ -27,8 +10,9 @@ from module.utils import parseFileSize class EasybytezCom(Account): __name__ = "EasybytezCom" - __version__ = "0.04" __type__ = "account" + __version__ = "0.04" + __description__ = """EasyBytez.com account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" @@ -36,26 +20,27 @@ class EasybytezCom(Account): VALID_UNTIL_PATTERN = r'Premium account expire:</TD><TD><b>([^<]+)</b>' TRAFFIC_LEFT_PATTERN = r'<TR><TD>Traffic available today:</TD><TD><b>(?P<S>[^<]+)</b>' + def loadAccountInfo(self, user, req): html = req.load("http://www.easybytez.com/?op=my_account", decode=True) validuntil = trafficleft = None premium = False - found = re.search(self.VALID_UNTIL_PATTERN, html) - if found: + m = re.search(self.VALID_UNTIL_PATTERN, html) + if m: try: - self.logDebug("Expire date: " + found.group(1)) - validuntil = mktime(strptime(found.group(1), "%d %B %Y")) + self.logDebug("Expire date: " + m.group(1)) + validuntil = mktime(strptime(m.group(1), "%d %B %Y")) except Exception, e: self.logError(e) if validuntil > mktime(gmtime()): premium = True trafficleft = -1 else: - found = re.search(self.TRAFFIC_LEFT_PATTERN, html) - if found: - trafficleft = found.group(1) + m = re.search(self.TRAFFIC_LEFT_PATTERN, html) + if m: + trafficleft = m.group(1) if "Unlimited" in trafficleft: trafficleft = -1 else: diff --git a/module/plugins/accounts/EgoFilesCom.py b/module/plugins/accounts/EgoFilesCom.py index e5c781068..41b58c4e7 100644 --- a/module/plugins/accounts/EgoFilesCom.py +++ b/module/plugins/accounts/EgoFilesCom.py @@ -9,14 +9,16 @@ from module.utils import parseFileSize class EgoFilesCom(Account): __name__ = "EgoFilesCom" - __version__ = "0.2" __type__ = "account" + __version__ = "0.2" + __description__ = """Egofiles.com account plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" PREMIUM_ACCOUNT_PATTERN = '<br/>\s*Premium: (?P<P>[^/]*) / Traffic left: (?P<T>[\d.]*) (?P<U>\w*)\s*\\n\s*<br/>' + def loadAccountInfo(self, user, req): html = req.load("http://egofiles.com") if 'You are logged as a Free User' in html: @@ -37,6 +39,6 @@ class EgoFilesCom(Account): html = req.load("http://egofiles.com/ajax/register.php", post={"log": 1, "loginV": user, - "passV": data["password"]}) + "passV": data['password']}) if 'Login successful' not in html: self.wrongPassword() diff --git a/module/plugins/accounts/EuroshareEu.py b/module/plugins/accounts/EuroshareEu.py index 3fb0d7f50..f37693206 100644 --- a/module/plugins/accounts/EuroshareEu.py +++ b/module/plugins/accounts/EuroshareEu.py @@ -1,22 +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 <http://www.gnu.org/licenses/>. - - @author: zoidberg -""" - from time import mktime, strptime import re @@ -25,22 +8,24 @@ from module.plugins.Account import Account class EuroshareEu(Account): __name__ = "EuroshareEu" - __version__ = "0.01" __type__ = "account" + __version__ = "0.01" + __description__ = """Euroshare.eu account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" + def loadAccountInfo(self, user, req): self.relogin(user) html = req.load("http://euroshare.eu/customer-zone/settings/") - found = re.search('id="input_expire_date" value="(\d+\.\d+\.\d+ \d+:\d+)"', html) - if found is None: + m = re.search('id="input_expire_date" value="(\d+\.\d+\.\d+ \d+:\d+)"', html) + if m is None: premium, validuntil = False, -1 else: premium = True - validuntil = mktime(strptime(found.group(1), "%d.%m.%Y %H:%M")) + validuntil = mktime(strptime(m.group(1), "%d.%m.%Y %H:%M")) return {"validuntil": validuntil, "trafficleft": -1, "premium": premium} @@ -49,7 +34,7 @@ class EuroshareEu(Account): html = req.load('http://euroshare.eu/customer-zone/login/', post={ "trvale": "1", "login": user, - "password": data["password"] + "password": data['password'] }, decode=True) if u">Nesprávne prihlasovacie meno alebo heslo" in html: diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index dbfd1f33e..7e46ccd05 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -6,15 +6,17 @@ from module.common.json_layer import json_loads class FastixRu(Account): __name__ = "FastixRu" - __version__ = "0.02" __type__ = "account" + __version__ = "0.02" + __description__ = """Fastix account plugin""" __author_name__ = "Massimo Rosamilia" __author_mail__ = "max@spiritix.eu" + def loadAccountInfo(self, user, req): data = self.getAccountData(user) - page = req.load("http://fastix.ru/api_v2/?apikey=%s&sub=getaccountdetails" % (data["api"])) + page = req.load("http://fastix.ru/api_v2/?apikey=%s&sub=getaccountdetails" % (data['api'])) page = json_loads(page) points = page['points'] kb = float(points) @@ -26,9 +28,9 @@ class FastixRu(Account): return account_info def login(self, user, data, req): - page = req.load("http://fastix.ru/api_v2/?sub=get_apikey&email=%s&password=%s" % (user, data["password"])) + page = req.load("http://fastix.ru/api_v2/?sub=get_apikey&email=%s&password=%s" % (user, data['password'])) api = json_loads(page) api = api['apikey'] - data["api"] = api + data['api'] = api if "error_code" in page: self.wrongPassword() diff --git a/module/plugins/accounts/FastshareCz.py b/module/plugins/accounts/FastshareCz.py index ba6105e6e..a968be19e 100644 --- a/module/plugins/accounts/FastshareCz.py +++ b/module/plugins/accounts/FastshareCz.py @@ -1,22 +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 <http://www.gnu.org/licenses/>. - - @author: zoidberg -""" - import re from module.plugins.Account import Account from module.utils import parseFileSize @@ -24,20 +7,22 @@ from module.utils import parseFileSize class FastshareCz(Account): __name__ = "FastshareCz" - __version__ = "0.03" __type__ = "account" + __version__ = "0.03" + __description__ = """Fastshare.cz account plugin""" __author_name__ = ("zoidberg", "stickell") __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") CREDIT_PATTERN = r'(?:Kredit|Credit)\s*</td>\s*<td[^>]*>([\d. \w]+) ' + def loadAccountInfo(self, user, req): html = req.load("http://www.fastshare.cz/user", decode=True) - found = re.search(self.CREDIT_PATTERN, html) - if found: - trafficleft = parseFileSize(found.group(1)) / 1024 + m = re.search(self.CREDIT_PATTERN, html) + if m: + trafficleft = parseFileSize(m.group(1)) / 1024 premium = True if trafficleft else False else: trafficleft = None diff --git a/module/plugins/accounts/File4safeCom.py b/module/plugins/accounts/File4safeCom.py index 6a11493d2..aa7894e98 100644 --- a/module/plugins/accounts/File4safeCom.py +++ b/module/plugins/accounts/File4safeCom.py @@ -5,8 +5,9 @@ from module.plugins.internal.XFSPAccount import XFSPAccount class File4safeCom(XFSPAccount): __name__ = "File4safeCom" - __version__ = "0.01" __type__ = "account" + __version__ = "0.01" + __description__ = """File4safe.com account plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" diff --git a/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py index f2becb8c9..ec98cf9b2 100644 --- a/module/plugins/accounts/FilecloudIo.py +++ b/module/plugins/accounts/FilecloudIo.py @@ -1,34 +1,19 @@ # -*- 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 <http://www.gnu.org/licenses/>. - - @author: zoidberg -""" - from module.plugins.Account import Account from module.common.json_layer import json_loads class FilecloudIo(Account): __name__ = "FilecloudIo" - __version__ = "0.02" __type__ = "account" + __version__ = "0.02" + __description__ = """FilecloudIo account plugin""" __author_name__ = ("zoidberg", "stickell") __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") + def loadAccountInfo(self, user, req): # It looks like the first API request always fails, so we retry 5 times, it should work on the second try for _ in xrange(5): @@ -50,7 +35,7 @@ class FilecloudIo(Account): rep = json_loads(rep) if rep['is_premium'] == 1: - return {"validuntil": int(rep["premium_until"]), "trafficleft": -1} + return {"validuntil": int(rep['premium_until']), "trafficleft": -1} else: return {"premium": False} @@ -61,8 +46,8 @@ class FilecloudIo(Account): if not hasattr(self, "form_data"): self.form_data = {} - self.form_data["username"] = user - self.form_data["password"] = data['password'] + self.form_data['username'] = user + self.form_data['password'] = data['password'] html = req.load('https://secure.filecloud.io/user-login_p.html', post=self.form_data, diff --git a/module/plugins/accounts/FilefactoryCom.py b/module/plugins/accounts/FilefactoryCom.py index 0eded0edf..84d80cab7 100644 --- a/module/plugins/accounts/FilefactoryCom.py +++ b/module/plugins/accounts/FilefactoryCom.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero 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 Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ import re from time import mktime, strptime @@ -24,14 +10,16 @@ from module.plugins.Account import Account class FilefactoryCom(Account): __name__ = "FilefactoryCom" - __version__ = "0.14" __type__ = "account" + __version__ = "0.14" + __description__ = """Filefactory.com account plugin""" __author_name__ = ("zoidberg", "stickell") __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") VALID_UNTIL_PATTERN = r'Premium valid until: <strong>(?P<d>\d{1,2})\w{1,2} (?P<m>\w{3}), (?P<y>\d{4})</strong>' + def loadAccountInfo(self, user, req): html = req.load("http://www.filefactory.com/account/") @@ -51,7 +39,7 @@ class FilefactoryCom(Account): html = req.load("http://www.filefactory.com/member/signin.php", post={ "loginEmail": user, - "loginPassword": data["password"], + "loginPassword": data['password'], "Submit": "Sign In"}) if req.lastEffectiveURL != "http://www.filefactory.com/account/": diff --git a/module/plugins/accounts/FilejungleCom.py b/module/plugins/accounts/FilejungleCom.py index 304f20040..72e275d4f 100644 --- a/module/plugins/accounts/FilejungleCom.py +++ b/module/plugins/accounts/FilejungleCom.py @@ -1,22 +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 <http://www.gnu.org/licenses/>. - - @author: zoidberg -""" - import re from time import mktime, strptime @@ -25,8 +8,9 @@ from module.plugins.Account import Account class FilejungleCom(Account): __name__ = "FilejungleCom" - __version__ = "0.11" __type__ = "account" + __version__ = "0.11" + __description__ = """Filejungle.com account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" @@ -37,12 +21,13 @@ class FilejungleCom(Account): TRAFFIC_LEFT_PATTERN = r'"/extend_premium\.php">Until (\d+ [A-Za-z]+ \d+)<br' LOGIN_FAILED_PATTERN = r'<span htmlfor="loginUser(Name|Password)" generated="true" class="fail_info">' + def loadAccountInfo(self, user, req): html = req.load(self.URL + "dashboard.php") - found = re.search(self.TRAFFIC_LEFT_PATTERN, html) - if found: + m = re.search(self.TRAFFIC_LEFT_PATTERN, html) + if m: premium = True - validuntil = mktime(strptime(found.group(1), "%d %b %Y")) + validuntil = mktime(strptime(m.group(1), "%d %b %Y")) else: premium = False validuntil = -1 @@ -52,7 +37,7 @@ class FilejungleCom(Account): def login(self, user, data, req): html = req.load(self.URL + "login.php", post={ "loginUserName": user, - "loginUserPassword": data["password"], + "loginUserPassword": data['password'], "loginFormSubmit": "Login", "recaptcha_challenge_field": "", "recaptcha_response_field": "", diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py index 28ddf2e3f..2e50298d7 100644 --- a/module/plugins/accounts/FilerNet.py +++ b/module/plugins/accounts/FilerNet.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero 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 Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ import re import time @@ -23,8 +9,9 @@ from module.utils import parseFileSize class FilerNet(Account): __name__ = "FilerNet" - __version__ = "0.01" __type__ = "account" + __version__ = "0.01" + __description__ = """Filer.net account plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" @@ -34,15 +21,16 @@ class FilerNet(Account): TRAFFIC_PATTERN = r'Traffic</th>\s*<td>([^<]+)</td>' FREE_PATTERN = r'Account Status</th>\s*<td>\s*Free' + def loadAccountInfo(self, user, req): - self.html = req.load("https://filer.net/profile") + html = req.load("https://filer.net/profile") # Free user - if re.search(self.FREE_PATTERN, self.html): + if re.search(self.FREE_PATTERN, html): return {"premium": False, "validuntil": None, "trafficleft": None} - until = re.search(self.WALID_UNTIL_PATTERN, self.html) - traffic = re.search(self.TRAFFIC_PATTERN, self.html) + until = re.search(self.WALID_UNTIL_PATTERN, html) + traffic = re.search(self.TRAFFIC_PATTERN, html) if until and traffic: validuntil = int(time.mktime(time.strptime(until.group(1), "%d.%m.%Y %H:%M:%S"))) trafficleft = parseFileSize(traffic.group(1)) / 1024 @@ -52,10 +40,10 @@ class FilerNet(Account): return {"premium": False, "validuntil": None, "trafficleft": None} def login(self, user, data, req): - self.html = req.load("https://filer.net/login") - token = re.search(self.TOKEN_PATTERN, self.html).group(1) - self.html = req.load("https://filer.net/login_check", - post={"_username": user, "_password": data["password"], + html = req.load("https://filer.net/login") + token = re.search(self.TOKEN_PATTERN, html).group(1) + html = req.load("https://filer.net/login_check", + post={"_username": user, "_password": data['password'], "_remember_me": "on", "_csrf_token": token, "_target_path": "https://filer.net/"}) - if 'Logout' not in self.html: + if 'Logout' not in html: self.wrongPassword() diff --git a/module/plugins/accounts/FilerioCom.py b/module/plugins/accounts/FilerioCom.py index 5f2164cf1..544a7f3a6 100644 --- a/module/plugins/accounts/FilerioCom.py +++ b/module/plugins/accounts/FilerioCom.py @@ -5,8 +5,9 @@ from module.plugins.internal.XFSPAccount import XFSPAccount class FilerioCom(XFSPAccount): __name__ = "FilerioCom" - __version__ = "0.01" __type__ = "account" + __version__ = "0.01" + __description__ = """FileRio.in account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" diff --git a/module/plugins/accounts/FilesMailRu.py b/module/plugins/accounts/FilesMailRu.py index 794e80d84..5ece67140 100644 --- a/module/plugins/accounts/FilesMailRu.py +++ b/module/plugins/accounts/FilesMailRu.py @@ -1,33 +1,18 @@ # -*- 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 <http://www.gnu.org/licenses/>. - - @author: RaNaN -""" - from module.plugins.Account import Account class FilesMailRu(Account): __name__ = "FilesMailRu" - __version__ = "0.1" __type__ = "account" + __version__ = "0.1" + __description__ = """Filesmail.ru account plugin""" __author_name__ = "RaNaN" __author_mail__ = "RaNaN@pyload.org" + def loadAccountInfo(self, user, req): return {"validuntil": None, "trafficleft": None} diff --git a/module/plugins/accounts/FileserveCom.py b/module/plugins/accounts/FileserveCom.py index 266935a9f..5be5e8d04 100644 --- a/module/plugins/accounts/FileserveCom.py +++ b/module/plugins/accounts/FileserveCom.py @@ -1,22 +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 <http://www.gnu.org/licenses/>. - - @author: mkaay -""" - from time import mktime, strptime from module.plugins.Account import Account @@ -25,34 +8,36 @@ from module.common.json_layer import json_loads class FileserveCom(Account): __name__ = "FileserveCom" - __version__ = "0.2" __type__ = "account" + __version__ = "0.2" + __description__ = """Fileserve.com account plugin""" __author_name__ = "mkaay" __author_mail__ = "mkaay@mkaay.de" + def loadAccountInfo(self, user, req): data = self.getAccountData(user) - page = req.load("http://app.fileserve.com/api/login/", post={"username": user, "password": data["password"], + page = req.load("http://app.fileserve.com/api/login/", post={"username": user, "password": data['password'], "submit": "Submit+Query"}) res = json_loads(page) - if res["type"] == "premium": - validuntil = mktime(strptime(res["expireTime"], "%Y-%m-%d %H:%M:%S")) - return {"trafficleft": res["traffic"], "validuntil": validuntil} + if res['type'] == "premium": + validuntil = mktime(strptime(res['expireTime'], "%Y-%m-%d %H:%M:%S")) + return {"trafficleft": res['traffic'], "validuntil": validuntil} else: return {"premium": False, "trafficleft": None, "validuntil": None} def login(self, user, data, req): - page = req.load("http://app.fileserve.com/api/login/", post={"username": user, "password": data["password"], + page = req.load("http://app.fileserve.com/api/login/", post={"username": user, "password": data['password'], "submit": "Submit+Query"}) res = json_loads(page) - if not res["type"]: + if not res['type']: self.wrongPassword() #login at fileserv page req.load("http://www.fileserve.com/login.php", - post={"loginUserName": user, "loginUserPassword": data["password"], "autoLogin": "checked", + post={"loginUserName": user, "loginUserPassword": data['password'], "autoLogin": "checked", "loginFormSubmit": "Login"}) diff --git a/module/plugins/accounts/FourSharedCom.py b/module/plugins/accounts/FourSharedCom.py index 869705313..206edca23 100644 --- a/module/plugins/accounts/FourSharedCom.py +++ b/module/plugins/accounts/FourSharedCom.py @@ -1,34 +1,19 @@ # -*- 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 <http://www.gnu.org/licenses/>. - - @author: zoidberg -""" - from module.plugins.Account import Account from module.common.json_layer import json_loads class FourSharedCom(Account): __name__ = "FourSharedCom" - __version__ = "0.01" __type__ = "account" + __version__ = "0.01" + __description__ = """FourShared.com account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" + def loadAccountInfo(self, user, req): #fixme return {"validuntil": -1, "trafficleft": -1, "premium": False} diff --git a/module/plugins/accounts/FreakshareCom.py b/module/plugins/accounts/FreakshareCom.py index 6628db6b1..dfa5f4541 100644 --- a/module/plugins/accounts/FreakshareCom.py +++ b/module/plugins/accounts/FreakshareCom.py @@ -1,21 +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 <http://www.gnu.org/licenses/>. - - @author: RaNaN -""" import re from time import strptime, mktime @@ -24,12 +8,14 @@ from module.plugins.Account import Account class FreakshareCom(Account): __name__ = "FreakshareCom" - __version__ = "0.1" __type__ = "account" + __version__ = "0.1" + __description__ = """Freakshare.com account plugin""" __author_name__ = "RaNaN" __author_mail__ = "RaNaN@pyload.org" + def loadAccountInfo(self, user, req): page = req.load("http://freakshare.com/") diff --git a/module/plugins/accounts/FreeWayMe.py b/module/plugins/accounts/FreeWayMe.py index 955cc3c7f..fe5a79949 100644 --- a/module/plugins/accounts/FreeWayMe.py +++ b/module/plugins/accounts/FreeWayMe.py @@ -1,34 +1,19 @@ # -*- 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 <http://www.gnu.org/licenses/>. - - @author: Nicolas Giese -""" - from module.plugins.Account import Account from module.common.json_layer import json_loads class FreeWayMe(Account): __name__ = "FreeWayMe" - __version__ = "0.11" __type__ = "account" + __version__ = "0.11" + __description__ = """FreeWayMe account plugin""" __author_name__ = "Nicolas Giese" __author_mail__ = "james@free-way.me" + def loadAccountInfo(self, user, req): status = self.getAccountStatus(user, req) if not status: @@ -36,19 +21,19 @@ class FreeWayMe(Account): self.logDebug(status) account_info = {"validuntil": -1, "premium": False} - if status["premium"] == "Free": - account_info["trafficleft"] = int(status["guthaben"]) * 1024 - elif status["premium"] == "Spender": - account_info["trafficleft"] = -1 - elif status["premium"] == "Flatrate": - account_info = {"validuntil": int(status["Flatrate"]), + if status['premium'] == "Free": + account_info['trafficleft'] = int(status['guthaben']) * 1024 + elif status['premium'] == "Spender": + account_info['trafficleft'] = -1 + elif status['premium'] == "Flatrate": + account_info = {"validuntil": int(status['Flatrate']), "trafficleft": -1, "premium": True} return account_info def getpw(self, user): - return self.accounts[user]["password"] + return self.accounts[user]['password'] def login(self, user, data, req): status = self.getAccountStatus(user, req) @@ -59,7 +44,7 @@ class FreeWayMe(Account): def getAccountStatus(self, user, req): answer = req.load("https://www.free-way.me/ajax/jd.php", - get={"id": 4, "user": user, "pass": self.accounts[user]["password"]}) + get={"id": 4, "user": user, "pass": self.accounts[user]['password']}) self.logDebug("login: %s" % answer) if answer == "Invalid login": self.wrongPassword() diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py index 61122b996..78714f238 100644 --- a/module/plugins/accounts/FshareVn.py +++ b/module/plugins/accounts/FshareVn.py @@ -1,22 +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 <http://www.gnu.org/licenses/>. - - @author: zoidberg -""" - from time import mktime, strptime from pycurl import REFERER import re @@ -26,8 +9,9 @@ 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") __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") @@ -37,18 +21,19 @@ class FshareVn(Account): TRAFFIC_LEFT_PATTERN = ur'<dt>Tổng Dung Lượng Tài Khoản</dt>\s*<dd[^>]*>([0-9.]+) ([kKMG])B</dd>' DIRECT_DOWNLOAD_PATTERN = ur'<input type="checkbox"\s*([^=>]*)[^>]*/>Kích hoạt download trực tiếp</dt>' + 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) - 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 @@ -60,15 +45,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'<img\s+alt="VIP"', self.html): + if not re.search(r'<img\s+alt="VIP"', html): self.wrongPassword() def getTrafficLeft(self): - found = re.search(self.TRAFFIC_LEFT_PATTERN, self.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 diff --git a/module/plugins/accounts/Ftp.py b/module/plugins/accounts/Ftp.py index 18e25c716..1319ea2a7 100644 --- a/module/plugins/accounts/Ftp.py +++ b/module/plugins/accounts/Ftp.py @@ -5,10 +5,12 @@ from module.plugins.Account import Account class Ftp(Account): __name__ = "Ftp" - __version__ = "0.01" __type__ = "account" + __version__ = "0.01" + __description__ = """Ftp dummy account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" + login_timeout = info_threshold = -1 #: Unlimited diff --git a/module/plugins/accounts/HellshareCz.py b/module/plugins/accounts/HellshareCz.py index b6c738715..9207cddab 100644 --- a/module/plugins/accounts/HellshareCz.py +++ b/module/plugins/accounts/HellshareCz.py @@ -1,22 +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 <http://www.gnu.org/licenses/>. - - @author: zoidberg -""" - import re import time @@ -25,25 +8,27 @@ from module.plugins.Account import Account class HellshareCz(Account): __name__ = "HellshareCz" - __version__ = "0.14" __type__ = "account" + __version__ = "0.14" + __description__ = """Hellshare.cz account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" CREDIT_LEFT_PATTERN = r'<div class="credit-link">\s*<table>\s*<tr>\s*<th>(\d+|\d\d\.\d\d\.)</th>' + def loadAccountInfo(self, user, req): self.relogin(user) html = req.load("http://www.hellshare.com/") - found = re.search(self.CREDIT_LEFT_PATTERN, html) - if found is None: + m = re.search(self.CREDIT_LEFT_PATTERN, html) + if m is None: trafficleft = None validuntil = None premium = False else: - credit = found.group(1) + credit = m.group(1) premium = True try: if "." in credit: @@ -80,7 +65,7 @@ class HellshareCz(Account): html = req.load('http://www.hellshare.com/login?do=loginForm-submit', post={ "login": "Log in", - "password": data["password"], + "password": data['password'], "username": user, "perm_login": "on" }) diff --git a/module/plugins/accounts/HotfileCom.py b/module/plugins/accounts/HotfileCom.py index f6988542f..cffbbab8f 100644 --- a/module/plugins/accounts/HotfileCom.py +++ b/module/plugins/accounts/HotfileCom.py @@ -1,22 +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 <http://www.gnu.org/licenses/>. - - @author: mkaay, JoKoT3 -""" - from time import strptime, mktime import hashlib @@ -25,12 +8,14 @@ from module.plugins.Account import Account class HotfileCom(Account): __name__ = "HotfileCom" - __version__ = "0.2" __type__ = "account" + __version__ = "0.2" + __description__ = """Hotfile.com account plugin""" __author_name__ = ("mkaay", "JoKoT3") __author_mail__ = ("mkaay@mkaay.de", "jokot3@gmail.com") + def loadAccountInfo(self, user, req): resp = self.apiCall("getuserinfo", user=user) if resp.startswith("."): @@ -42,12 +27,12 @@ class HotfileCom(Account): info[key] = value if info['is_premium'] == '1': - info["premium_until"] = info["premium_until"].replace("T", " ") - zone = info["premium_until"][19:] - info["premium_until"] = info["premium_until"][:19] + info['premium_until'] = info['premium_until'].replace("T", " ") + zone = info['premium_until'][19:] + info['premium_until'] = info['premium_until'][:19] zone = int(zone[:3]) - validuntil = int(mktime(strptime(info["premium_until"], "%Y-%m-%d %H:%M:%S"))) + (zone * 60 * 60) + validuntil = int(mktime(strptime(info['premium_until'], "%Y-%m-%d %H:%M:%S"))) + (zone * 60 * 60) tmp = {"validuntil": validuntil, "trafficleft": -1, "premium": True} elif info['is_premium'] == '0': @@ -65,7 +50,7 @@ class HotfileCom(Account): digest = req.load("http://api.hotfile.com/", post={"action": "getdigest"}) h = hashlib.md5() - h.update(data["password"]) + h.update(data['password']) hp = h.hexdigest() h = hashlib.md5() h.update(hp) @@ -82,7 +67,7 @@ class HotfileCom(Account): cj = self.getAccountCookies(user) cj.setCookie("hotfile.com", "lang", "en") req.load("http://hotfile.com/", cookies=True) - page = req.load("http://hotfile.com/login.php", post={"returnto": "/", "user": user, "pass": data["password"]}, + page = req.load("http://hotfile.com/login.php", post={"returnto": "/", "user": user, "pass": data['password']}, cookies=True) if "Bad username/password" in page: diff --git a/module/plugins/accounts/Http.py b/module/plugins/accounts/Http.py index 932b0aa64..589a45617 100644 --- a/module/plugins/accounts/Http.py +++ b/module/plugins/accounts/Http.py @@ -5,10 +5,12 @@ from module.plugins.Account import Account class Http(Account): __name__ = "Http" - __version__ = "0.01" __type__ = "account" + __version__ = "0.01" + __description__ = """Http dummy account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" + login_timeout = info_threshold = -1 #: Unlimited diff --git a/module/plugins/accounts/LetitbitNet.py b/module/plugins/accounts/LetitbitNet.py index e37c860a6..c849f9d2d 100644 --- a/module/plugins/accounts/LetitbitNet.py +++ b/module/plugins/accounts/LetitbitNet.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero 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 Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ from module.plugins.Account import Account # from module.common.json_layer import json_loads, json_dumps @@ -20,16 +6,18 @@ from module.plugins.Account import Account class LetitbitNet(Account): __name__ = "LetitbitNet" - __version__ = "0.01" __type__ = "account" + __version__ = "0.01" + __description__ = """Letitbit.net account plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" + def loadAccountInfo(self, user, req): ## DISABLED BECAUSE IT GET 'key exausted' EVEN IF VALID ## # api_key = self.accounts[user]['password'] - # json_data = [api_key, ["key/info"]] + # json_data = [api_key, ['key/info']] # api_rep = req.load('http://api.letitbit.net/json', post={'r': json_dumps(json_data)}) # self.logDebug('API Key Info: ' + api_rep) # api_rep = json_loads(api_rep) diff --git a/module/plugins/accounts/LinksnappyCom.py b/module/plugins/accounts/LinksnappyCom.py index 63b9576d6..a03357e25 100644 --- a/module/plugins/accounts/LinksnappyCom.py +++ b/module/plugins/accounts/LinksnappyCom.py @@ -8,12 +8,14 @@ from module.common.json_layer import json_loads class LinksnappyCom(Account): __name__ = "LinksnappyCom" - __version__ = "0.02" __type__ = "account" + __version__ = "0.02" + __description__ = """Linksnappy.com account plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" + def loadAccountInfo(self, user, req): data = self.getAccountData(user) r = req.load('http://gen.linksnappy.com/lseAPI.php', diff --git a/module/plugins/accounts/MegaDebridEu.py b/module/plugins/accounts/MegaDebridEu.py index 1fbe00ff7..9c5603989 100644 --- a/module/plugins/accounts/MegaDebridEu.py +++ b/module/plugins/accounts/MegaDebridEu.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero 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 Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ from module.plugins.Account import Account from module.common.json_layer import json_loads @@ -20,8 +6,9 @@ from module.common.json_layer import json_loads class MegaDebridEu(Account): __name__ = "MegaDebridEu" - __version__ = "0.2" __type__ = "account" + __version__ = "0.2" + __description__ = """mega-debrid.eu account plugin""" __author_name__ = "D.Ducatel" __author_mail__ = "dducatel@je-geek.fr" @@ -29,21 +16,22 @@ class MegaDebridEu(Account): # Define the base URL of MegaDebrid api API_URL = "https://www.mega-debrid.eu/api.php" + def loadAccountInfo(self, user, req): data = self.getAccountData(user) jsonResponse = req.load(self.API_URL, - get={'action': 'connectUser', 'login': user, 'password': data["password"]}) + get={'action': 'connectUser', 'login': user, 'password': data['password']}) response = json_loads(jsonResponse) - if response["response_code"] == "ok": - return {"premium": True, "validuntil": float(response["vip_end"]), "status": True} + if response['response_code'] == "ok": + return {"premium": True, "validuntil": float(response['vip_end']), "status": True} else: self.logError(response) return {"status": False, "premium": False} def login(self, user, data, req): jsonResponse = req.load(self.API_URL, - get={'action': 'connectUser', 'login': user, 'password': data["password"]}) + get={'action': 'connectUser', 'login': user, 'password': data['password']}) response = json_loads(jsonResponse) - if response["response_code"] != "ok": + if response['response_code'] != "ok": self.wrongPassword() diff --git a/module/plugins/accounts/MegasharesCom.py b/module/plugins/accounts/MegasharesCom.py index 59aefe374..7c4777706 100644 --- a/module/plugins/accounts/MegasharesCom.py +++ b/module/plugins/accounts/MegasharesCom.py @@ -8,14 +8,16 @@ from module.plugins.Account import Account class MegasharesCom(Account): __name__ = "MegasharesCom" - __version__ = "0.02" __type__ = "account" + __version__ = "0.02" + __description__ = """Megashares.com account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" VALID_UNTIL_PATTERN = r'<p class="premium_info_box">Period Ends: (\w{3} \d{1,2}, \d{4})</p>' + def loadAccountInfo(self, user, req): #self.relogin(user) html = req.load("http://d01.megashares.com/myms.php", decode=True) diff --git a/module/plugins/accounts/MovReelCom.py b/module/plugins/accounts/MovReelCom.py index 2225261f0..34862c4ef 100644 --- a/module/plugins/accounts/MovReelCom.py +++ b/module/plugins/accounts/MovReelCom.py @@ -5,14 +5,15 @@ from module.plugins.internal.XFSPAccount import XFSPAccount class MovReelCom(XFSPAccount): __name__ = "MovReelCom" - __version__ = "0.01" __type__ = "account" + __version__ = "0.01" + __description__ = """Movreel.com account plugin""" __author_name__ = "t4skforce" __author_mail__ = "t4skforce1337[AT]gmail[DOT]com" - login_timeout = 60 #: after that time [in minutes] pyload will relogin the account - info_threshold = 30 #: account data will be reloaded after this time + login_timeout = 60 + info_threshold = 30 MAIN_PAGE = "http://movreel.com/" diff --git a/module/plugins/accounts/MultiDebridCom.py b/module/plugins/accounts/MultiDebridCom.py index 704b4ac78..c731ce9ae 100644 --- a/module/plugins/accounts/MultiDebridCom.py +++ b/module/plugins/accounts/MultiDebridCom.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero 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 Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ from time import time @@ -22,12 +8,14 @@ from module.common.json_layer import json_loads class MultiDebridCom(Account): __name__ = "MultiDebridCom" - __version__ = "0.01" __type__ = "account" + __version__ = "0.01" + __description__ = """Multi-debrid.com account plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" + def loadAccountInfo(self, user, req): if 'days_left' in self.json_data: validuntil = int(time() + self.json_data['days_left'] * 24 * 60 * 60) @@ -37,10 +25,10 @@ class MultiDebridCom(Account): def login(self, user, data, req): # Password to use is the API-Password written in http://multi-debrid.com/myaccount - self.html = req.load("http://multi-debrid.com/api.php", - get={"user": user, "pass": data["password"]}) - self.logDebug('JSON data: ' + self.html) - self.json_data = json_loads(self.html) + html = req.load("http://multi-debrid.com/api.php", + get={"user": user, "pass": data['password']}) + self.logDebug('JSON data: ' + html) + self.json_data = json_loads(html) if self.json_data['status'] != 'ok': self.logError('Invalid login. The password to use is the API-Password you find in your "My Account" page') self.wrongPassword() diff --git a/module/plugins/accounts/MultishareCz.py b/module/plugins/accounts/MultishareCz.py index cd2fd575c..fc13bac69 100644 --- a/module/plugins/accounts/MultishareCz.py +++ b/module/plugins/accounts/MultishareCz.py @@ -1,22 +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 <http://www.gnu.org/licenses/>. - - @author: zoidberg -""" - from module.plugins.Account import Account #from time import mktime, strptime #from pycurl import REFERER @@ -26,8 +9,9 @@ from module.utils import parseFileSize class MultishareCz(Account): __name__ = "MultishareCz" - __version__ = "0.02" __type__ = "account" + __version__ = "0.02" + __description__ = """Multishare.cz account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" @@ -35,12 +19,13 @@ class MultishareCz(Account): TRAFFIC_LEFT_PATTERN = r'<span class="profil-zvyrazneni">Kredit:</span>\s*<strong>(?P<S>[0-9,]+) (?P<U>\w+)</strong>' ACCOUNT_INFO_PATTERN = r'<input type="hidden" id="(u_ID|u_hash)" name="[^"]*" value="([^"]+)">' + def loadAccountInfo(self, user, req): #self.relogin(user) html = req.load("http://www.multishare.cz/profil/", decode=True) - found = re.search(self.TRAFFIC_LEFT_PATTERN, html) - trafficleft = parseFileSize(found.group('S'), found.group('U')) / 1024 if found else 0 + m = re.search(self.TRAFFIC_LEFT_PATTERN, html) + trafficleft = parseFileSize(m.group('S'), m.group('U')) / 1024 if m else 0 self.premium = True if trafficleft else False html = req.load("http://www.multishare.cz/", decode=True) diff --git a/module/plugins/accounts/NetloadIn.py b/module/plugins/accounts/NetloadIn.py index 3d2b52470..12c5556fb 100755 --- a/module/plugins/accounts/NetloadIn.py +++ b/module/plugins/accounts/NetloadIn.py @@ -1,22 +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 <http://www.gnu.org/licenses/>. - - @author: mkaay -""" - import re from time import time @@ -25,12 +8,14 @@ from module.plugins.Account import Account class NetloadIn(Account): __name__ = "NetloadIn" - __version__ = "0.22" __type__ = "account" + __version__ = "0.22" + __description__ = """Netload.in account plugin""" __author_name__ = ("RaNaN", "CryNickSystems") __author_mail__ = ("RaNaN@pyload.org", "webmaster@pcProfil.de") + def loadAccountInfo(self, user, req): page = req.load("http://netload.in/index.php?id=2&lang=de") left = r">(\d+) (Tag|Tage), (\d+) Stunden<" diff --git a/module/plugins/accounts/OboomCom.py b/module/plugins/accounts/OboomCom.py index 19fcea67a..a37759f9a 100644 --- a/module/plugins/accounts/OboomCom.py +++ b/module/plugins/accounts/OboomCom.py @@ -2,21 +2,24 @@ import time -from module.plugins.Account import Account from module.lib.beaker.crypto.pbkdf2 import PBKDF2 + from module.common.json_layer import json_loads +from module.plugins.Account import Account class OboomCom(Account): __name__ = "OboomCom" - __version__ = "0.1" __type__ = "account" + __version__ = "0.1" + __description__ = """Oboom.com account plugin""" __author_name__ = "stanley" __author_mail__ = "stanley.foerster@gmail.com" + def loadAccountData(self, user, req): - passwd = self.getAccountData(user)["password"] + passwd = self.getAccountData(user)['password'] salt = passwd[::-1] pbkdf2 = PBKDF2(passwd, salt, 1000).hexread(16) result = json_loads(req.load("https://www.oboom.com/1.0/login", get={"auth": user, "pass": pbkdf2})) @@ -27,17 +30,17 @@ class OboomCom(Account): def loadAccountInfo(self, name, req): accountData = self.loadAccountData(name, req) - userData = accountData["user"] + userData = accountData['user'] if "premium_unix" in userData: - validUntilUtc = int(userData["premium_unix"]) + validUntilUtc = int(userData['premium_unix']) if validUntilUtc > int(time.time()): premium = True validUntil = validUntilUtc - traffic = userData["traffic"] - trafficLeft = traffic["current"] - maxTraffic = traffic["max"] - session = accountData["session"] + traffic = userData['traffic'] + trafficLeft = traffic['current'] + maxTraffic = traffic['max'] + session = accountData['session'] return {"premium": premium, "validuntil": validUntil, "trafficleft": trafficLeft / 1024, diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py index b10e34314..43dd1c2b6 100644 --- a/module/plugins/accounts/OneFichierCom.py +++ b/module/plugins/accounts/OneFichierCom.py @@ -9,14 +9,16 @@ from module.plugins.Account import Account class OneFichierCom(Account): __name__ = "OneFichierCom" - __version__ = "0.1" __type__ = "account" + __version__ = "0.1" + __description__ = """1fichier.com account plugin""" - __author_name__ = ("Elrick69") - __author_mail__ = ("elrick69[AT]rocketmail[DOT]com") + __author_name__ = "Elrick69" + __author_mail__ = "elrick69[AT]rocketmail[DOT]com" VALID_UNTIL_PATTERN = r'You are a premium user until (?P<d>\d{2})/(?P<m>\d{2})/(?P<y>\d{4})' + def loadAccountInfo(self, user, req): html = req.load("http://1fichier.com/console/abo.pl") @@ -39,7 +41,7 @@ class OneFichierCom(Account): html = req.load("http://1fichier.com/login.pl?lg=en", post={ "mail": user, - "pass": data["password"], + "pass": data['password'], "Login": "Login"}) if r'<div class="error_message">Invalid username or password.</div>' in html: diff --git a/module/plugins/accounts/OverLoadMe.py b/module/plugins/accounts/OverLoadMe.py index eab20480f..34f684cb1 100644 --- a/module/plugins/accounts/OverLoadMe.py +++ b/module/plugins/accounts/OverLoadMe.py @@ -6,28 +6,30 @@ from module.common.json_layer import json_loads class OverLoadMe(Account): __name__ = "OverLoadMe" - __version__ = "0.01" __type__ = "account" + __version__ = "0.01" + __description__ = """Over-Load.me account plugin""" __author_name__ = "marley" __author_mail__ = "marley@over-load.me" + def loadAccountInfo(self, user, req): data = self.getAccountData(user) - page = req.load("https://api.over-load.me/account.php", get={"user": user, "auth": data["password"]}).strip() + page = req.load("https://api.over-load.me/account.php", get={"user": user, "auth": data['password']}).strip() data = json_loads(page) # Check for premium - if data["membership"] == "Free": + if data['membership'] == "Free": return {"premium": False} - account_info = {"validuntil": data["expirationunix"], "trafficleft": -1} + account_info = {"validuntil": data['expirationunix'], "trafficleft": -1} return account_info def login(self, user, data, req): jsondata = req.load("https://api.over-load.me/account.php", - get={"user": user, "auth": data["password"]}).strip() + get={"user": user, "auth": data['password']}).strip() data = json_loads(jsondata) - if data["err"] == 1: + if data['err'] == 1: self.wrongPassword() diff --git a/module/plugins/accounts/Premium4Me.py b/module/plugins/accounts/Premium4Me.py index c80f40f5c..9f66af414 100644 --- a/module/plugins/accounts/Premium4Me.py +++ b/module/plugins/accounts/Premium4Me.py @@ -5,12 +5,14 @@ from module.plugins.Account import Account class Premium4Me(Account): __name__ = "Premium4Me" - __version__ = "0.03" __type__ = "account" + __version__ = "0.03" + __description__ = """Premium.to account plugin""" __author_name__ = ("RaNaN", "zoidberg", "stickell") __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz", "l.stickell@yahoo.it") + def loadAccountInfo(self, user, req): traffic = req.load("http://premium.to/api/traffic.php?authcode=%s" % self.authcode) @@ -21,7 +23,7 @@ class Premium4Me(Account): def login(self, user, data, req): self.authcode = req.load("http://premium.to/api/getauthcode.php?username=%s&password=%s" % ( - user, data["password"])).strip() + user, data['password'])).strip() if "wrong username" in self.authcode: self.wrongPassword() diff --git a/module/plugins/accounts/PremiumizeMe.py b/module/plugins/accounts/PremiumizeMe.py index 1da5d9002..dcf8b8f20 100644 --- a/module/plugins/accounts/PremiumizeMe.py +++ b/module/plugins/accounts/PremiumizeMe.py @@ -7,12 +7,14 @@ from module.common.json_layer import json_loads class PremiumizeMe(Account): __name__ = "PremiumizeMe" - __version__ = "0.11" __type__ = "account" + __version__ = "0.11" + __description__ = """Premiumize.me account plugin""" __author_name__ = "Florian Franzen" __author_mail__ = "FlorianFranzen@gmail.com" + def loadAccountInfo(self, user, req): # Get user data from premiumize.me status = self.getAccountStatus(user, req) diff --git a/module/plugins/accounts/QuickshareCz.py b/module/plugins/accounts/QuickshareCz.py index 5a69a7f66..fcaf14e92 100644 --- a/module/plugins/accounts/QuickshareCz.py +++ b/module/plugins/accounts/QuickshareCz.py @@ -1,22 +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 <http://www.gnu.org/licenses/>. - - @author: zoidberg -""" - import re from module.plugins.Account import Account from module.utils import parseFileSize @@ -24,18 +7,20 @@ from module.utils import parseFileSize class QuickshareCz(Account): __name__ = "QuickshareCz" - __version__ = "0.01" __type__ = "account" + __version__ = "0.01" + __description__ = """Quickshare.cz account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" + def loadAccountInfo(self, user, req): html = req.load("http://www.quickshare.cz/premium", decode=True) - found = re.search(r'Stav kreditu: <strong>(.+?)</strong>', html) - if found: - trafficleft = parseFileSize(found.group(1)) / 1024 + m = re.search(r'Stav kreditu: <strong>(.+?)</strong>', html) + if m: + trafficleft = parseFileSize(m.group(1)) / 1024 premium = True if trafficleft else False else: trafficleft = None diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py index 49a294d14..358f6ffca 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -6,12 +6,14 @@ from module.common.json_layer import json_loads class RPNetBiz(Account): __name__ = "RPNetBiz" - __version__ = "0.1" __type__ = "account" + __version__ = "0.1" + __description__ = """RPNet.biz account plugin""" __author_name__ = "Dman" __author_mail__ = "dmanugm@gmail.com" + def loadAccountInfo(self, user, req): # Get account information from rpnet.biz response = self.getAccountStatus(user, req) diff --git a/module/plugins/accounts/RapidgatorNet.py b/module/plugins/accounts/RapidgatorNet.py index c008a0db3..849933a87 100644 --- a/module/plugins/accounts/RapidgatorNet.py +++ b/module/plugins/accounts/RapidgatorNet.py @@ -1,36 +1,21 @@ # -*- 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 <http://www.gnu.org/licenses/>. - - @author: zoidberg -""" - from module.plugins.Account import Account from module.common.json_layer import json_loads class RapidgatorNet(Account): __name__ = "RapidgatorNet" - __version__ = "0.04" __type__ = "account" + __version__ = "0.04" + __description__ = """Rapidgator.net account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" API_URL = 'http://rapidgator.net/api/user' + def loadAccountInfo(self, user, req): try: sid = self.getAccountData(user).get('SID') diff --git a/module/plugins/accounts/RapidshareCom.py b/module/plugins/accounts/RapidshareCom.py index 17d7f0e08..dc4f09ee1 100644 --- a/module/plugins/accounts/RapidshareCom.py +++ b/module/plugins/accounts/RapidshareCom.py @@ -1,38 +1,23 @@ # -*- 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 <http://www.gnu.org/licenses/>. - - @author: mkaay -""" - from module.plugins.Account import Account class RapidshareCom(Account): __name__ = "RapidshareCom" - __version__ = "0.22" __type__ = "account" + __version__ = "0.22" + __description__ = """Rapidshare.com account plugin""" __author_name__ = "mkaay" __author_mail__ = "mkaay@mkaay.de" + def loadAccountInfo(self, user, req): data = self.getAccountData(user) api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi" api_param_prem = {"sub": "getaccountdetails", "type": "prem", "login": user, - "password": data["password"], "withcookie": 1} + "password": data['password'], "withcookie": 1} src = req.load(api_url_base, cookies=False, get=api_param_prem) if src.startswith("ERROR"): raise Exception(src) @@ -44,7 +29,7 @@ class RapidshareCom(Account): k, v = t.split("=") info[k] = v - validuntil = int(info["billeduntil"]) + validuntil = int(info['billeduntil']) premium = True if validuntil else False tmp = {"premium": premium, "validuntil": validuntil, "trafficleft": -1, "maxtraffic": -1} @@ -54,7 +39,7 @@ class RapidshareCom(Account): def login(self, user, data, req): api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi" api_param_prem = {"sub": "getaccountdetails", "type": "prem", "login": user, - "password": data["password"], "withcookie": 1} + "password": data['password'], "withcookie": 1} src = req.load(api_url_base, cookies=False, get=api_param_prem) if src.startswith("ERROR"): raise Exception(src + "### Note you have to use your account number for login, instead of name.") @@ -66,4 +51,4 @@ class RapidshareCom(Account): k, v = t.split("=") info[k] = v cj = self.getAccountCookies(user) - cj.setCookie("rapidshare.com", "enc", info["cookie"]) + cj.setCookie("rapidshare.com", "enc", info['cookie']) diff --git a/module/plugins/accounts/RarefileNet.py b/module/plugins/accounts/RarefileNet.py index 494941aef..c8eae79a8 100644 --- a/module/plugins/accounts/RarefileNet.py +++ b/module/plugins/accounts/RarefileNet.py @@ -5,8 +5,9 @@ from module.plugins.internal.XFSPAccount import XFSPAccount class RarefileNet(XFSPAccount): __name__ = "RarefileNet" - __version__ = "0.02" __type__ = "account" + __version__ = "0.02" + __description__ = """RareFile.net account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" diff --git a/module/plugins/accounts/RealdebridCom.py b/module/plugins/accounts/RealdebridCom.py index 86ad18085..9d1939c60 100644 --- a/module/plugins/accounts/RealdebridCom.py +++ b/module/plugins/accounts/RealdebridCom.py @@ -7,12 +7,14 @@ from module.plugins.Account import Account class RealdebridCom(Account): __name__ = "RealdebridCom" - __version__ = "0.43" __type__ = "account" + __version__ = "0.43" + __description__ = """Real-Debrid.com account plugin""" __author_name__ = "Devirex Hazzard" __author_mail__ = "naibaf_11@yahoo.de" + def loadAccountInfo(self, user, req): if self.pin_code: return {"premium": False} @@ -25,7 +27,7 @@ class RealdebridCom(Account): def login(self, user, data, req): self.pin_code = False - page = req.load("https://real-debrid.com/ajax/login.php", get={"user": user, "pass": data["password"]}) + page = req.load("https://real-debrid.com/ajax/login.php", get={"user": user, "pass": data['password']}) if "Your login informations are incorrect" in page: self.wrongPassword() elif "PIN Code required" in page: diff --git a/module/plugins/accounts/RehostTo.py b/module/plugins/accounts/RehostTo.py index c4aa85484..f15230f83 100644 --- a/module/plugins/accounts/RehostTo.py +++ b/module/plugins/accounts/RehostTo.py @@ -5,15 +5,17 @@ from module.plugins.Account import Account class RehostTo(Account): __name__ = "RehostTo" - __version__ = "0.1" __type__ = "account" + __version__ = "0.1" + __description__ = """Rehost.to account plugin""" __author_name__ = "RaNaN" __author_mail__ = "RaNaN@pyload.org" + def loadAccountInfo(self, user, req): data = self.getAccountData(user) - page = req.load("http://rehost.to/api.php?cmd=login&user=%s&pass=%s" % (user, data["password"])) + page = req.load("http://rehost.to/api.php?cmd=login&user=%s&pass=%s" % (user, data['password'])) data = [x.split("=") for x in page.split(",")] ses = data[0][1] long_ses = data[1][1] @@ -29,7 +31,7 @@ class RehostTo(Account): return account_info def login(self, user, data, req): - page = req.load("http://rehost.to/api.php?cmd=login&user=%s&pass=%s" % (user, data["password"])) + page = req.load("http://rehost.to/api.php?cmd=login&user=%s&pass=%s" % (user, data['password'])) if "Login failed." in page: self.wrongPassword() diff --git a/module/plugins/accounts/ReloadCc.py b/module/plugins/accounts/ReloadCc.py deleted file mode 100644 index af23d9936..000000000 --- a/module/plugins/accounts/ReloadCc.py +++ /dev/null @@ -1,75 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.Account import Account - -from module.common.json_layer import json_loads - -from module.network.HTTPRequest import BadHeader - - -class ReloadCc(Account): - __name__ = "ReloadCc" - __version__ = "0.3" - __type__ = "account" - __description__ = """Reload.cc account plugin""" - - __author_name__ = "Reload Team" - __author_mail__ = "hello@reload.cc" - - def loadAccountInfo(self, user, req): - - # Get user data from reload.cc - status = self.getAccountStatus(user, req) - - # Parse account info - account_info = {"validuntil": float(status['msg']['expires']), - "pwdhash": status['msg']['hash'], - "trafficleft": -1} - - return account_info - - def login(self, user, data, req): - - # Get user data from reload.cc - status = self.getAccountStatus(user, req) - - if not status: - raise Exception("There was an error upon logging in to Reload.cc!") - - # Check if user and password are valid - if status['status'] != "ok": - self.wrongPassword() - - def getAccountStatus(self, user, req): - # Use reload.cc API v1 to retrieve account info and return the parsed json answer - query_params = dict( - via='pyload', - v=1, - get_traffic='true', - user=user - ) - - try: - query_params.update(dict(hash=self.infos[user]['pwdhash'])) - except Exception: - query_params.update(dict(pwd=self.accounts[user]['password'])) - - try: - answer = req.load("http://api.reload.cc/login", get=query_params) - except BadHeader, e: - if e.code == 400: - raise Exception("There was an unknown error within the Reload.cc plugin.") - elif e.code == 401: - self.wrongPassword() - elif e.code == 402: - self.expired(user) - elif e.code == 403: - raise Exception("Your account is disabled. Please contact the Reload.cc support!") - elif e.code == 409: - self.empty(user) - elif e.code == 503: - self.logInfo("Reload.cc is currently in maintenance mode! Please check again later.") - self.wrongPassword() - return None - - return json_loads(answer) diff --git a/module/plugins/accounts/RyushareCom.py b/module/plugins/accounts/RyushareCom.py index 6a15c4c82..7fb373ca7 100644 --- a/module/plugins/accounts/RyushareCom.py +++ b/module/plugins/accounts/RyushareCom.py @@ -5,17 +5,19 @@ from module.plugins.internal.XFSPAccount import XFSPAccount class RyushareCom(XFSPAccount): __name__ = "RyushareCom" - __version__ = "0.03" __type__ = "account" + __version__ = "0.03" + __description__ = """Ryushare.com account plugin""" __author_name__ = ("zoidberg", "trance4us") __author_mail__ = ("zoidberg@mujmail.cz", "") MAIN_PAGE = "http://ryushare.com/" + def login(self, user, data, req): req.lastURL = "http://ryushare.com/login.python" html = req.load("http://ryushare.com/login.python", - post={"login": user, "password": data["password"], "op": "login"}) + post={"login": user, "password": data['password'], "op": "login"}) if 'Incorrect Login or Password' in html or '>Error<' in html: self.wrongPassword() diff --git a/module/plugins/accounts/ShareRapidCom.py b/module/plugins/accounts/ShareRapidCom.py index 38150e5cf..50077b1fb 100644 --- a/module/plugins/accounts/ShareRapidCom.py +++ b/module/plugins/accounts/ShareRapidCom.py @@ -1,49 +1,52 @@ # -*- coding: utf-8 -*- import re + from time import mktime, strptime from module.plugins.Account import Account class ShareRapidCom(Account): __name__ = "ShareRapidCom" - __version__ = "0.33" __type__ = "account" - __description__ = """ShareRapid account plugin""" + __version__ = "0.34" + + __description__ = """MegaRapid.cz account plugin""" __author_name__ = ("MikyWoW", "zoidberg") __author_mail__ = ("mikywow@seznam.cz", "zoidberg@mujmail.cz") login_timeout = 60 + def loadAccountInfo(self, user, req): - src = req.load("http://sharerapid.cz/mujucet/", decode=True) + src = req.load("http://megarapid.cz/mujucet/", decode=True) - found = re.search(ur'<td>Max. počet paralelních stahování: </td><td>(\d+)', src) - if found: + m = re.search(ur'<td>Max. počet paralelních stahování: </td><td>(\d+)', src) + if m: data = self.getAccountData(user) - data["options"]["limitDL"] = [int(found.group(1))] + data['options']['limitDL'] = [int(m.group(1))] - found = re.search(ur'<td>Paušální stahování aktivní. Vyprší </td><td><strong>(.*?)</strong>', src) - if found: - validuntil = mktime(strptime(found.group(1), "%d.%m.%Y - %H:%M")) + m = re.search(ur'<td>Paušální stahování aktivní. Vyprší </td><td><strong>(.*?)</strong>', src) + if m: + validuntil = mktime(strptime(m.group(1), "%d.%m.%Y - %H:%M")) return {"premium": True, "trafficleft": -1, "validuntil": validuntil} - found = re.search(r'<tr><td>Kredit</td><td>(.*?) GiB', src) - if found: - trafficleft = float(found.group(1)) * (1 << 20) + m = re.search(r'<tr><td>Kredit</td><td>(.*?) GiB', src) + if m: + trafficleft = float(m.group(1)) * (1 << 20) return {"premium": True, "trafficleft": trafficleft, "validuntil": -1} return {"premium": False, "trafficleft": None, "validuntil": None} def login(self, user, data, req): - htm = req.load("http://sharerapid.cz/prihlaseni/", cookies=True) + htm = req.load("http://megarapid.cz/prihlaseni/", cookies=True) if "Heslo:" in htm: start = htm.index('id="inp_hash" name="hash" value="') htm = htm[start + 33:] hashes = htm[0:32] - htm = req.load("http://sharerapid.cz/prihlaseni/", + htm = req.load("http://megarapid.cz/prihlaseni/", post={"hash": hashes, "login": user, - "pass1": data["password"], + "pass1": data['password'], "remember": 0, "sbmt": u"Přihlásit"}, cookies=True) diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index f188fc580..b9ff0096c 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -1,36 +1,21 @@ # -*- 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 <http://www.gnu.org/licenses/>. - - @author: mkaay -""" - from module.plugins.Account import Account class ShareonlineBiz(Account): __name__ = "ShareonlineBiz" - __version__ = "0.24" __type__ = "account" + __version__ = "0.24" + __description__ = """Share-online.biz account plugin""" __author_name__ = ("mkaay", "zoidberg") __author_mail__ = ("mkaay@mkaay.de", "zoidberg@mujmail.cz") + def getUserAPI(self, user, req): return req.load("http://api.share-online.biz/account.php", - {"username": user, "password": self.accounts[user]["password"], "act": "userDetails"}) + {"username": user, "password": self.accounts[user]['password'], "act": "userDetails"}) def loadAccountInfo(self, user, req): src = self.getUserAPI(user, req) @@ -42,14 +27,14 @@ class ShareonlineBiz(Account): info[key] = value self.logDebug(info) - if "dl" in info and info["dl"].lower() != "not_available": - req.cj.setCookie("share-online.biz", "dl", info["dl"]) - if "a" in info and info["a"].lower() != "not_available": - req.cj.setCookie("share-online.biz", "a", info["a"]) + if "dl" in info and info['dl'].lower() != "not_available": + req.cj.setCookie("share-online.biz", "dl", info['dl']) + if "a" in info and info['a'].lower() != "not_available": + req.cj.setCookie("share-online.biz", "a", info['a']) - return {"validuntil": int(info["expire_date"]) if "expire_date" in info else -1, + return {"validuntil": int(info['expire_date']) if "expire_date" in info else -1, "trafficleft": -1, - "premium": True if ("dl" in info or "a" in info) and (info["group"] != "Sammler") else False} + "premium": True if ("dl" in info or "a" in info) and (info['group'] != "Sammler") else False} def login(self, user, data, req): src = self.getUserAPI(user, req) diff --git a/module/plugins/accounts/SimplyPremiumCom.py b/module/plugins/accounts/SimplyPremiumCom.py index 1e6d66806..b0a62f83b 100644 --- a/module/plugins/accounts/SimplyPremiumCom.py +++ b/module/plugins/accounts/SimplyPremiumCom.py @@ -1,31 +1,18 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero 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 Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ - -from module.plugins.Account import Account from module.common.json_layer import json_loads +from module.plugins.Account import Account class SimplyPremiumCom(Account): __name__ = "SimplyPremiumCom" - __version__ = "0.01" __type__ = "account" - __description__ = """Simply-Premium.Com account plugin""" - __author_name__ = ("EvolutionClip") - __author_mail__ = ("evolutionclip@live.de") + __version__ = "0.01" + + __description__ = """Simply-Premium.com account plugin""" + __author_name__ = "EvolutionClip" + __author_mail__ = "evolutionclip@live.de" + def loadAccountInfo(self, user, req): json_data = req.load('http://www.simply-premium.com/api/user.php?format=json') @@ -50,9 +37,9 @@ class SimplyPremiumCom(Account): if data['password'] == '' or data['password'] == '0': post_data = {"key": user} else: - post_data = {"login_name": user, "login_pass": data["password"]} + post_data = {"login_name": user, "login_pass": data['password']} - self.html = req.load("http://www.simply-premium.com/login.php", post=post_data) + html = req.load("http://www.simply-premium.com/login.php", post=post_data) - if 'logout' not in self.html: + if 'logout' not in html: self.wrongPassword() diff --git a/module/plugins/accounts/SimplydebridCom.py b/module/plugins/accounts/SimplydebridCom.py index c07702105..70f2d39b9 100644 --- a/module/plugins/accounts/SimplydebridCom.py +++ b/module/plugins/accounts/SimplydebridCom.py @@ -7,12 +7,14 @@ from module.plugins.Account import Account class SimplydebridCom(Account): __name__ = "SimplydebridCom" - __version__ = "0.1" __type__ = "account" + __version__ = "0.1" + __description__ = """Simply-Debrid.com account plugin""" __author_name__ = "Kagenoshin" __author_mail__ = "kagenoshin@gmx.ch" + def loadAccountInfo(self, user, req): get_data = {'login': 2, 'u': self.loginname, 'p': self.password} response = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True) @@ -24,7 +26,7 @@ class SimplydebridCom(Account): def login(self, user, data, req): self.loginname = user - self.password = data["password"] + self.password = data['password'] get_data = {'login': 1, 'u': self.loginname, 'p': self.password} response = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True) if response != "02: loggin success": diff --git a/module/plugins/accounts/StahnuTo.py b/module/plugins/accounts/StahnuTo.py index 529e2131f..6d9c3e924 100644 --- a/module/plugins/accounts/StahnuTo.py +++ b/module/plugins/accounts/StahnuTo.py @@ -1,22 +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 <http://www.gnu.org/licenses/>. - - @author: zoidberg -""" - import re from module.plugins.Account import Account @@ -25,26 +8,26 @@ from module.utils import parseFileSize class StahnuTo(Account): __name__ = "StahnuTo" - __version__ = "0.02" __type__ = "account" + __version__ = "0.02" + __description__ = """StahnuTo account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - #login_timeout = 60 def loadAccountInfo(self, user, req): html = req.load("http://www.stahnu.to/") - found = re.search(r'>VIP: (\d+.*)<', html) - trafficleft = parseFileSize(found.group(1)) * 1024 if found else 0 + m = re.search(r'>VIP: (\d+.*)<', html) + trafficleft = parseFileSize(m.group(1)) * 1024 if m else 0 return {"premium": trafficleft > (512 * 1024), "trafficleft": trafficleft, "validuntil": -1} def login(self, user, data, req): html = req.load("http://www.stahnu.to/login.php", post={ "username": user, - "password": data["password"], + "password": data['password'], "submit": "Login"}) if not '<a href="logout.php">' in html: diff --git a/module/plugins/accounts/TurbobitNet.py b/module/plugins/accounts/TurbobitNet.py index 19ffaf1e5..a477b06c0 100644 --- a/module/plugins/accounts/TurbobitNet.py +++ b/module/plugins/accounts/TurbobitNet.py @@ -1,22 +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 <http://www.gnu.org/licenses/>. - - @author: zoidberg -""" - import re from time import mktime, strptime @@ -25,21 +8,21 @@ from module.plugins.Account import Account class TurbobitNet(Account): __name__ = "TurbobitNet" - __version__ = "0.01" __type__ = "account" + __version__ = "0.01" + __description__ = """TurbobitNet account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - #login_timeout = 60 def loadAccountInfo(self, user, req): html = req.load("http://turbobit.net") - found = re.search(r'<u>Turbo Access</u> to ([0-9.]+)', html) - if found: + m = re.search(r'<u>Turbo Access</u> to ([0-9.]+)', html) + if m: premium = True - validuntil = mktime(strptime(found.group(1), "%d.%m.%Y")) + validuntil = mktime(strptime(m.group(1), "%d.%m.%Y")) else: premium = False validuntil = -1 @@ -51,7 +34,7 @@ class TurbobitNet(Account): html = req.load("http://turbobit.net/user/login", post={ "user[login]": user, - "user[pass]": data["password"], + "user[pass]": data['password'], "user[submit]": "Login"}) if not '<div class="menu-item user-name">' in html: diff --git a/module/plugins/accounts/UlozTo.py b/module/plugins/accounts/UlozTo.py index 6b1067f28..6f0d0ae7d 100644 --- a/module/plugins/accounts/UlozTo.py +++ b/module/plugins/accounts/UlozTo.py @@ -7,22 +7,24 @@ from module.plugins.Account import Account class UlozTo(Account): __name__ = "UlozTo" - __version__ = "0.06" __type__ = "account" + __version__ = "0.06" + __description__ = """Uloz.to account plugin""" __author_name__ = ("zoidberg", "pulpe") __author_mail__ = "zoidberg@mujmail.cz" TRAFFIC_LEFT_PATTERN = r'<li class="menu-kredit"><a href="/kredit" title="[^"]*?GB = ([0-9.]+) MB"' + def loadAccountInfo(self, user, req): #this cookie gets lost somehow after each request self.phpsessid = req.cj.getCookie("ULOSESSID") html = req.load("http://www.ulozto.net/", decode=True) req.cj.setCookie("www.ulozto.net", "ULOSESSID", self.phpsessid) - found = re.search(self.TRAFFIC_LEFT_PATTERN, html) - trafficleft = int(float(found.group(1).replace(' ', '').replace(',', '.')) * 1000 * 1.048) if found else 0 + m = re.search(self.TRAFFIC_LEFT_PATTERN, html) + trafficleft = int(float(m.group(1).replace(' ', '').replace(',', '.')) * 1000 * 1.048) if m else 0 self.premium = True if trafficleft else False return {"validuntil": -1, "trafficleft": trafficleft} diff --git a/module/plugins/accounts/UnrestrictLi.py b/module/plugins/accounts/UnrestrictLi.py index 2b647a49c..a65f19c5b 100644 --- a/module/plugins/accounts/UnrestrictLi.py +++ b/module/plugins/accounts/UnrestrictLi.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero 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 Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see <http://www.gnu.org/licenses/>. # -############################################################################ from module.plugins.Account import Account from module.common.json_layer import json_loads @@ -20,12 +6,14 @@ from module.common.json_layer import json_loads class UnrestrictLi(Account): __name__ = "UnrestrictLi" - __version__ = "0.03" __type__ = "account" + __version__ = "0.03" + __description__ = """Unrestrict.li account plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" + def loadAccountInfo(self, user, req): json_data = req.load('http://unrestrict.li/api/jdownloader/user.php?format=json') self.logDebug("JSON data: " + json_data) @@ -47,9 +35,9 @@ class UnrestrictLi(Account): self.logError("A Captcha is required. Go to http://unrestrict.li/sign_in and login, then retry") return - post_data = {"username": user, "password": data["password"], + post_data = {"username": user, "password": data['password'], "remember_me": "remember", "signin": "Sign in"} - self.html = req.load("https://unrestrict.li/sign_in", post=post_data) + html = req.load("https://unrestrict.li/sign_in", post=post_data) - if 'sign_out' not in self.html: + if 'sign_out' not in html: self.wrongPassword() diff --git a/module/plugins/accounts/UploadedTo.py b/module/plugins/accounts/UploadedTo.py index 02f31c544..9db496bbc 100644 --- a/module/plugins/accounts/UploadedTo.py +++ b/module/plugins/accounts/UploadedTo.py @@ -1,22 +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 <http://www.gnu.org/licenses/>. - - @author: mkaay -""" - import re from time import time @@ -25,12 +8,14 @@ from module.plugins.Account import Account class UploadedTo(Account): __name__ = "UploadedTo" - __version__ = "0.26" __type__ = "account" + __version__ = "0.26" + __description__ = """Uploaded.to account plugin""" __author_name__ = "mkaay" __author_mail__ = "mkaay@mkaay.de" + def loadAccountInfo(self, user, req): req.load("http://uploaded.net/language/en") @@ -62,7 +47,7 @@ class UploadedTo(Account): req.load("http://uploaded.net/language/en") req.cj.setCookie("uploaded.net", "lang", "en") - page = req.load("http://uploaded.net/io/login", post={"id": user, "pw": data["password"], "_": ""}) + page = req.load("http://uploaded.net/io/login", post={"id": user, "pw": data['password'], "_": ""}) if "User and password do not match!" in page: self.wrongPassword() diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py index 8adcff4ac..20f209268 100644 --- a/module/plugins/accounts/UploadheroCom.py +++ b/module/plugins/accounts/UploadheroCom.py @@ -9,12 +9,14 @@ from module.plugins.Account import Account class UploadheroCom(Account): __name__ = "UploadheroCom" - __version__ = "0.2" __type__ = "account" + __version__ = "0.2" + __description__ = """Uploadhero.co account plugin""" __author_name__ = "mcmyst" __author_mail__ = "mcmyst@hotmail.fr" + def loadAccountInfo(self, user, req): premium_pattern = re.compile('Il vous reste <span class="bleu">([0-9]+)</span> jours premium.') @@ -32,7 +34,7 @@ class UploadheroCom(Account): def login(self, user, data, req): page = req.load("http://uploadhero.co/lib/connexion.php", - post={"pseudo_login": user, "password_login": data["password"]}) + post={"pseudo_login": user, "password_login": data['password']}) if "mot de passe invalide" in page: self.wrongPassword() diff --git a/module/plugins/accounts/UploadingCom.py b/module/plugins/accounts/UploadingCom.py index f0395c13a..416a29b1e 100644 --- a/module/plugins/accounts/UploadingCom.py +++ b/module/plugins/accounts/UploadingCom.py @@ -1,22 +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 <http://www.gnu.org/licenses/>. - - @author: mkaay -""" - from time import time, strptime, mktime import re @@ -25,12 +8,14 @@ from module.plugins.Account import Account class UploadingCom(Account): __name__ = "UploadingCom" - __version__ = "0.1" __type__ = "account" + __version__ = "0.1" + __description__ = """Uploading.com account plugin""" __author_name__ = "mkaay" __author_mail__ = "mkaay@mkaay.de" + def loadAccountInfo(self, user, req): src = req.load("http://uploading.com/") premium = True @@ -52,4 +37,4 @@ class UploadingCom(Account): req.cj.setCookie("uploading.com", "_lang", "en") req.load("http://uploading.com/") req.load("http://uploading.com/general/login_form/?JsHttpRequest=%s-xml" % long(time() * 1000), - post={"email": user, "password": data["password"], "remember": "on"}) + post={"email": user, "password": data['password'], "remember": "on"}) diff --git a/module/plugins/accounts/UptoboxCom.py b/module/plugins/accounts/UptoboxCom.py index 3757ae0aa..60de213ae 100644 --- a/module/plugins/accounts/UptoboxCom.py +++ b/module/plugins/accounts/UptoboxCom.py @@ -5,8 +5,9 @@ from module.plugins.internal.XFSPAccount import XFSPAccount class UptoboxCom(XFSPAccount): __name__ = "UptoboxCom" - __version__ = "0.02" __type__ = "account" + __version__ = "0.02" + __description__ = """DDLStorage.com account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" diff --git a/module/plugins/accounts/Vipleech4uCom.py b/module/plugins/accounts/Vipleech4uCom.py deleted file mode 100644 index 1e8463456..000000000 --- a/module/plugins/accounts/Vipleech4uCom.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -import re -from time import mktime, strptime - -from module.plugins.Account import Account - - -class Vipleech4uCom(Account): - __name__ = "Vipleech4uCom" - __version__ = "0.1" - __type__ = "account" - __description__ = """Vipleech4u.com account plugin""" - __author_name__ = ("Kagenoshin") - __author_mail__ = ("kagenoshin@gmx.ch") - - STATUS_PATTERN = re.compile(r'status.*?<\s*?strong\s*?>[^<]*?vip[^<]*?<', re.I) - VALIDUNTIL_PATTERN = re.compile(r'valid\s*?until.*?<\s*?strong\s*?>([^<]*?)<', re.I) - - def loadAccountInfo(self, user, req): - response = req.load("http://vipleech4u.com", decode=True) - status = self.STATUS_PATTERN.search(response) - - validuntil = self.VALIDUNTIL_PATTERN.search(response) - if validuntil: - validuntil = validuntil.group(1) - - if status and validuntil: - print status - print validuntil - return {"trafficleft": -1, "validuntil": mktime(strptime("%s 23:59" % validuntil, "%d-%m-%Y %H:%M"))} - else: - return {"premium": False} - - def login(self, user, data, req): - self.loginname = user - self.password = data["password"] - post_data = {'action': 'login', 'user': self.loginname, 'pass': self.password} - req.load("http://vipleech4u.com/login.php") - response = req.load("http://vipleech4u.com/login.php", post=post_data, decode=True) - if 'Username or Password are incorrect' in response: - self.wrongPassword() diff --git a/module/plugins/accounts/WarserverCz.py b/module/plugins/accounts/WarserverCz.py deleted file mode 100644 index a5acf5e52..000000000 --- a/module/plugins/accounts/WarserverCz.py +++ /dev/null @@ -1,68 +0,0 @@ -# -*- 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 <http://www.gnu.org/licenses/>. - - @author: zoidberg -""" - -import re - -from module.plugins.Account import Account -from module.utils import parseFileSize - - -class WarserverCz(Account): - __name__ = "WarserverCz" - __version__ = "0.02" - __type__ = "account" - __description__ = """Warserver.cz account plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" - - VALID_UNTIL_PATTERN = ur'<li>Neomezené stahování do: <strong>(.+?)<' - TRAFFIC_LEFT_PATTERN = ur'<li>Kredit: <strong>(.+?)<' - - DOMAIN = "http://www.warserver.cz" - - def loadAccountInfo(self, user, req): - html = req.load("%s/uzivatele/prehled" % self.DOMAIN, decode=True) - - validuntil = trafficleft = None - premium = False - - found = re.search(self.VALID_UNTIL_PATTERN, html) - if found: - self.logDebug("VALID_UNTIL", found.group(1)) - try: - #validuntil = mktime(strptime(found.group(1), "%d %B %Y")) - premium = True - trafficleft = -1 - except Exception, e: - self.logError(e) - - found = re.search(self.TRAFFIC_LEFT_PATTERN, html) - if found: - self.logDebug("TRAFFIC_LEFT", found.group(1)) - trafficleft = parseFileSize((found.group(1).replace(" ", ""))) // 1024 - premium = True if trafficleft > 1 << 18 else False - - return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium} - - def login(self, user, data, req): - html = req.load('%s/uzivatele/prihlaseni?do=prihlaseni-submit' % self.DOMAIN, - post={"username": user, "password": data['password'], "send": u"Přihlásit"}, decode=True) - - if '<p class="chyba">' in html: - self.wrongPassword() diff --git a/module/plugins/accounts/YibaishiwuCom.py b/module/plugins/accounts/YibaishiwuCom.py index 75aae25b9..be62d3f40 100644 --- a/module/plugins/accounts/YibaishiwuCom.py +++ b/module/plugins/accounts/YibaishiwuCom.py @@ -1,22 +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 <http://www.gnu.org/licenses/>. - - @author: zoidberg -""" - import re from module.plugins.Account import Account @@ -24,21 +7,23 @@ from module.plugins.Account import Account class YibaishiwuCom(Account): __name__ = "YibaishiwuCom" - __version__ = "0.01" __type__ = "account" + __version__ = "0.01" + __description__ = """115.com account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" ACCOUNT_INFO_PATTERN = r'var USER_PERMISSION = {(.*?)}' + def loadAccountInfo(self, user, req): #self.relogin(user) html = req.load("http://115.com/", decode=True) - found = re.search(self.ACCOUNT_INFO_PATTERN, html, re.S) - premium = True if (found and 'is_vip: 1' in found.group(1)) else False - validuntil = trafficleft = (-1 if found else 0) + m = re.search(self.ACCOUNT_INFO_PATTERN, html, re.S) + premium = True if (m and 'is_vip: 1' in m.group(1)) else False + validuntil = trafficleft = (-1 if m else 0) return dict({"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium}) def login(self, user, data, req): diff --git a/module/plugins/accounts/ZeveraCom.py b/module/plugins/accounts/ZeveraCom.py index 1eb90801a..db1ebd4ae 100644 --- a/module/plugins/accounts/ZeveraCom.py +++ b/module/plugins/accounts/ZeveraCom.py @@ -7,12 +7,14 @@ from module.plugins.Account import Account class ZeveraCom(Account): __name__ = "ZeveraCom" - __version__ = "0.21" __type__ = "account" + __version__ = "0.21" + __description__ = """Zevera.com account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" + def loadAccountInfo(self, user, req): data = self.getAPIData(req) if data == "No traffic": @@ -27,7 +29,7 @@ class ZeveraCom(Account): def login(self, user, data, req): self.loginname = user - self.password = data["password"] + self.password = data['password'] if self.getAPIData(req) == "No traffic": self.wrongPassword() |