diff options
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r-- | module/plugins/accounts/CoolshareCz.py | 71 | ||||
-rw-r--r-- | module/plugins/accounts/FilesonicCom.py | 70 | ||||
-rw-r--r-- | module/plugins/accounts/MegauploadCom.py | 53 | ||||
-rwxr-xr-x | module/plugins/accounts/OronCom.py | 54 |
4 files changed, 0 insertions, 248 deletions
diff --git a/module/plugins/accounts/CoolshareCz.py b/module/plugins/accounts/CoolshareCz.py deleted file mode 100644 index 03686c729..000000000 --- a/module/plugins/accounts/CoolshareCz.py +++ /dev/null @@ -1,71 +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 -""" - -#shares code with WarserverCz - -from module.plugins.Account import Account -import re -from time import mktime, strptime - -class CoolshareCz(Account): - __name__ = "CoolshareCz" - __version__ = "0.01" - __type__ = "account" - __description__ = """CoolShare.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>.*?\(\s*(.+?)\s*B\)' - - DOMAIN = "http://www.coolshare.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 = int(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()
\ No newline at end of file diff --git a/module/plugins/accounts/FilesonicCom.py b/module/plugins/accounts/FilesonicCom.py deleted file mode 100644 index 1207f1b56..000000000 --- a/module/plugins/accounts/FilesonicCom.py +++ /dev/null @@ -1,70 +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: RaNaN -""" - -from time import mktime, strptime - -from module.plugins.Account import Account -from module.common.json_layer import json_loads - -class FilesonicCom(Account): - __name__ = "FilesonicCom" - __version__ = "0.31" - __type__ = "account" - __description__ = """filesonic.com account plugin""" - __author_name__ = ("RaNaN", "Paul King") - __author_mail__ = ("RaNaN@pyload.org", "") - - API_URL = "http://api.filesonic.com" - - def getDomain(self, req): - xml = req.load(self.API_URL + "/utility?method=getFilesonicDomainForCurrentIp&format=json", - decode=True) - return json_loads(xml)["FSApi_Utility"]["getFilesonicDomainForCurrentIp"]["response"] - - def loadAccountInfo(self, user, req): - xml = req.load(self.API_URL + "/user?method=getInfo&format=json", - post={"u": user, - "p": self.accounts[user]["password"]}, decode=True) - - self.logDebug("account status retrieved from api %s" % xml) - - json = json_loads(xml) - if json["FSApi_User"]["getInfo"]["status"] != "success": - self.logError(_("Invalid login retrieving user details")) - return {"validuntil": -1, "trafficleft": -1, "premium": False} - premium = json["FSApi_User"]["getInfo"]["response"]["users"]["user"]["is_premium"] - if premium: - validuntil = json["FSApi_User"]["getInfo"]["response"]["users"]["user"]["premium_expiration"] - validuntil = int(mktime(strptime(validuntil, "%Y-%m-%d %H:%M:%S"))) - else: - validuntil = -1 - return {"validuntil": validuntil, "trafficleft": -1, "premium": premium} - - def login(self, user, data, req): - domain = self.getDomain(req) - - post_vars = { - "email": user, - "password": data["password"], - "rememberMe": 1 - } - page = req.load("http://www%s/user/login" % domain, cookies=True, post=post_vars, decode=True) - - if "Provided password does not match." in page or "You must be logged in to view this page." in page: - self.wrongPassword() diff --git a/module/plugins/accounts/MegauploadCom.py b/module/plugins/accounts/MegauploadCom.py deleted file mode 100644 index ff4f5971c..000000000 --- a/module/plugins/accounts/MegauploadCom.py +++ /dev/null @@ -1,53 +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: mkaay -""" - -import re -from time import time - -from module.plugins.Account import Account - -class MegauploadCom(Account): - __name__ = "MegauploadCom" - __version__ = "0.12" - __type__ = "account" - __description__ = """megaupload account plugin""" - __author_name__ = ("RaNaN") - __author_mail__ = ("RaNaN@pyload.org") - - def loadAccountInfo(self, user, req): - page = req.load("http://www.megaupload.com/?c=account&setlang=en", decode = True) - - premium = False if r'<div class="account_txt">Regular' in page else True - validuntil = -1 - - if premium: - found = re.search(r'class="account_txt">\s*(\d+)\s*(days|hours|minutes) remaining', page) - if found: - validuntil = time() + 60 * int(found.group(1)) * {"days": 1440, "hours": 60, "minutes": 1}[found.group(2)] - - if '<div class="account_txt" id="ddltxt"> Deactivated </div>' in page: - self.core.log.warning(_("Activate direct Download in your MegaUpload Account")) - - return {"validuntil": validuntil, "trafficleft": -1, "premium": premium} - - - def login(self, user, data, req): - page = req.load("http://www.megaupload.com/?c=login&next=c%3Dpremium", post={ "username" : user, "password" : data["password"], "login" :"1"}, cookies=True) - if "Username and password do not match" in page: - self.wrongPassword() diff --git a/module/plugins/accounts/OronCom.py b/module/plugins/accounts/OronCom.py deleted file mode 100755 index 793984121..000000000 --- a/module/plugins/accounts/OronCom.py +++ /dev/null @@ -1,54 +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: DHMH -""" - -from module.plugins.Account import Account -import re -from time import strptime, mktime - -class OronCom(Account): - __name__ = "OronCom" - __version__ = "0.12" - __type__ = "account" - __description__ = """oron.com account plugin""" - __author_name__ = ("DHMH") - __author_mail__ = ("DHMH@pyload.org") - - def loadAccountInfo(self, user, req): - req.load("http://oron.com/?op=change_lang&lang=german") - src = req.load("http://oron.com/?op=my_account").replace("\n", "") - validuntil = re.search(r"<td>Premiumaccount läuft bis:</td>\s*<td>(.*?)</td>", src) - if validuntil: - validuntil = validuntil.group(1) - validuntil = int(mktime(strptime(validuntil, "%d %B %Y"))) - trafficleft = re.search(r'<td>Download Traffic verfügbar:</td>\s*<td>(.*?)</td>', src).group(1) - self.logDebug("Oron left: " + trafficleft) - trafficleft = int(self.parseTraffic(trafficleft)) - premium = True - else: - validuntil = -1 - trafficleft = None - premium = False - tmp = {"validuntil": validuntil, "trafficleft": trafficleft, "premium" : premium} - return tmp - - def login(self, user, data, req): - req.load("http://oron.com/?op=change_lang&lang=german") - page = req.load("http://oron.com/login", post={"login": user, "password": data["password"], "op": "login"}) - if r'<b class="err">Login oder Passwort falsch</b>' in page: - self.wrongPassword() |