diff options
Diffstat (limited to 'module/plugins/accounts')
71 files changed, 646 insertions, 539 deletions
diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index 1f2371e28..e9084dcc3 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -1,19 +1,18 @@ # -*- coding: utf-8 -*- import re -import xml.dom.minidom as dom - -from time import time +import time +import xml.dom.minidom from BeautifulSoup import BeautifulSoup -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class AlldebridCom(Account): __name__ = "AlldebridCom" __type__ = "account" - __version__ = "0.23" + __version__ = "0.24" __description__ = """AllDebrid.com account plugin""" __license__ = "GPLv3" @@ -33,26 +32,26 @@ class AlldebridCom(Account): p = re.compile('\d+') exp_data = p.findall(time_text) - exp_time = time() + int(exp_data[0]) * 24 * 60 * 60 + int( + exp_time = time.time() + int(exp_data[0]) * 24 * 60 * 60 + int( exp_data[1]) * 60 * 60 + (int(exp_data[2]) - 1) * 60 #Get expiration date from API - except: + except Exception: data = self.getAccountData(user) - html = req.load("http://www.alldebrid.com/api.php", + html = req.load("https://www.alldebrid.com/api.php", get={'action': "info_user", 'login': user, 'pw': data['password']}) self.logDebug(html) - xml = dom.parseString(html) - exp_time = time() + int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue) * 24 * 60 * 60 + xml = xml.dom.minidom.parseString(html) + exp_time = time.time() + int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue) * 24 * 60 * 60 account_info = {"validuntil": exp_time, "trafficleft": -1} return account_info def login(self, user, data, req): - html = req.load("http://www.alldebrid.com/register/", + html = req.load("https://www.alldebrid.com/register/", get={'action' : "login", 'login_login' : user, 'login_password': data['password']}, diff --git a/module/plugins/accounts/BitshareCom.py b/module/plugins/accounts/BitshareCom.py index 412aae534..afbed2920 100644 --- a/module/plugins/accounts/BitshareCom.py +++ b/module/plugins/accounts/BitshareCom.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class BitshareCom(Account): __name__ = "BitshareCom" __type__ = "account" - __version__ = "0.13" + __version__ = "0.14" __description__ = """Bitshare account plugin""" __license__ = "GPLv3" @@ -26,9 +26,8 @@ class BitshareCom(Account): def login(self, user, data, req): - html = req.load("http://bitshare.com/login.html", + html = req.load("https://bitshare.com/login.html", post={"user": user, "password": data['password'], "submit": "Login"}, - cookies=True, decode=True) if "login" in req.lastEffectiveURL: diff --git a/module/plugins/accounts/CatShareNet.py b/module/plugins/accounts/CatShareNet.py index bcb14bee3..ae2b69dfa 100644 --- a/module/plugins/accounts/CatShareNet.py +++ b/module/plugins/accounts/CatShareNet.py @@ -1,52 +1,56 @@ # -*- coding: utf-8 -*- import re +import time -from time import mktime, strptime - -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class CatShareNet(Account): __name__ = "CatShareNet" __type__ = "account" - __version__ = "0.02" + __version__ = "0.07" - __description__ = """CatShareNet account plugin""" + __description__ = """Catshare.net account plugin""" __license__ = "GPLv3" __authors__ = [("prOq", None)] - PREMIUM_PATTERN = r'class="nav-collapse collapse pull-right">[\s\w<>=-."/:]*\sz.</a></li>\s*<li><a href="/premium">.*\s*<span style="color: red">(.*?)</span>[\s\w<>/]*href="/logout"' - VALID_UNTIL_PATTERN = r'<div class="span6 pull-right">[\s\w<>=-":;]*<span style="font-size:13px;">.*?<strong>(.*?)</strong></span>' + PREMIUM_PATTERN = r'<a href="/premium">Konto:[\s\n]*Premium' + VALID_UNTIL_PATTERN = r'>Konto premium.*?<strong>(.*?)</strong></span>' + TRAFFIC_LEFT_PATTERN = r'<a href="/premium">([0-9.]+ [kMG]B)' def loadAccountInfo(self, user, req): - premium = False - validuntil = -1 + premium = False + validuntil = -1 + trafficleft = -1 html = req.load("http://catshare.net/", decode=True) + if re.search(self.PREMIUM_PATTERN, html): + premium = True + try: - m = re.search(self.PREMIUM_PATTERN, html) - if "Premium" in m.group(1): - premium = True - except: + expiredate = re.search(self.VALID_UNTIL_PATTERN, html).group(1) + self.logDebug("Expire date: " + expiredate) + + validuntil = time.mktime(time.strptime(expiredate, "%Y-%m-%d %H:%M:%S")) + + except Exception: pass try: - m = re.search(self.VALID_UNTIL_PATTERN, html) - expiredate = m.group(1) - if "-" not in expiredate: - validuntil = mktime(strptime(expiredate, "%d.%m.%Y")) - except: + trafficleft = self.parseTraffic(re.search(self.TRAFFIC_LEFT_PATTERN, html).group(1)) + + except Exception: pass - return {'premium': premium, 'trafficleft': -1, 'validuntil': validuntil} + return {'premium': premium, 'trafficleft': trafficleft, 'validuntil': validuntil} def login(self, user, data, req): - html = req.load("http://catshare.net/login", + html = req.load("http://catshare.net/login", #@TODO: Revert to `https` in 0.4.10 post={'user_email': user, 'user_password': data['password'], 'remindPassword': 0, diff --git a/module/plugins/accounts/CloudzillaTo.py b/module/plugins/accounts/CloudzillaTo.py index d22d5e4b3..48e0fd5c3 100644 --- a/module/plugins/accounts/CloudzillaTo.py +++ b/module/plugins/accounts/CloudzillaTo.py @@ -2,13 +2,13 @@ import re -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class CloudzillaTo(Account): __name__ = "CloudzillaTo" __type__ = "account" - __version__ = "0.02" + __version__ = "0.03" __description__ = """Cloudzilla.to account plugin""" __license__ = "GPLv3" @@ -27,7 +27,7 @@ class CloudzillaTo(Account): def login(self, user, data, req): - html = req.load("http://www.cloudzilla.to/", + html = req.load("https://www.cloudzilla.to/", post={'lusername': user, 'lpassword': data['password'], 'w' : "dologin"}, diff --git a/module/plugins/accounts/CzshareCom.py b/module/plugins/accounts/CzshareCom.py index f84bc67f3..67869551a 100644 --- a/module/plugins/accounts/CzshareCom.py +++ b/module/plugins/accounts/CzshareCom.py @@ -1,15 +1,15 @@ # -*- coding: utf-8 -*- -from time import mktime, strptime import re +import time -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class CzshareCom(Account): __name__ = "CzshareCom" __type__ = "account" - __version__ = "0.16" + __version__ = "0.19" __description__ = """Czshare.com account plugin, now Sdilej.cz""" __license__ = "GPLv3" @@ -21,15 +21,26 @@ class CzshareCom(Account): def loadAccountInfo(self, user, req): + premium = False + validuntil = None + trafficleft = None + html = req.load("http://sdilej.cz/prehled_kreditu/") - m = re.search(self.CREDIT_LEFT_PATTERN, html) - if m is None: - return {"validuntil": 0, "trafficleft": 0} + try: + m = re.search(self.CREDIT_LEFT_PATTERN, html) + trafficleft = self.parseTraffic(m.group(1).replace(' ', '').replace(',', '.')) + m.group(2) + validuntil = time.mktime(time.strptime(m.group(3), '%d.%m.%y %H:%M')) + + except Exception, e: + self.logError(e) + else: - trafficleft = self.parseTraffic(m.group(1).replace(' ', '').replace(',', '.')) + m.group(2)] - validuntil = mktime(strptime(m.group(3), '%d.%m.%y %H:%M')) - return {"validuntil": validuntil, "trafficleft": trafficleft} + premium = True + + return {'premium' : premium, + 'validuntil' : validuntil, + 'trafficleft': trafficleft} def login(self, user, data, req): diff --git a/module/plugins/accounts/DebridItaliaCom.py b/module/plugins/accounts/DebridItaliaCom.py index 50f9aea27..4fe4fcecc 100644 --- a/module/plugins/accounts/DebridItaliaCom.py +++ b/module/plugins/accounts/DebridItaliaCom.py @@ -1,16 +1,15 @@ # -*- coding: utf-8 -*- import re +import time -from time import mktime, strptime - -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class DebridItaliaCom(Account): __name__ = "DebridItaliaCom" __type__ = "account" - __version__ = "0.13" + __version__ = "0.14" __description__ = """Debriditalia.com account plugin""" __license__ = "GPLv3" @@ -28,7 +27,7 @@ class DebridItaliaCom(Account): if 'Account premium not activated' not in html: m = re.search(self.WALID_UNTIL_PATTERN, html) if m: - validuntil = mktime(strptime(m.group(1), "%d/%m/%Y %H:%M")) + validuntil = time.mktime(time.strptime(m.group(1), "%d/%m/%Y %H:%M")) info = {"premium": True, "validuntil": validuntil, "trafficleft": -1} else: self.logError(_("Unable to retrieve account information")) @@ -37,7 +36,7 @@ class DebridItaliaCom(Account): def login(self, user, data, req): - html = req.load("http://debriditalia.com/login.php", + html = req.load("https://debriditalia.com/login.php", get={'u': user, 'p': data['password']}, decode=True) diff --git a/module/plugins/accounts/DepositfilesCom.py b/module/plugins/accounts/DepositfilesCom.py index dfe430276..234ad0b7a 100644 --- a/module/plugins/accounts/DepositfilesCom.py +++ b/module/plugins/accounts/DepositfilesCom.py @@ -1,16 +1,15 @@ # -*- coding: utf-8 -*- import re +import time -from time import strptime, mktime - -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class DepositfilesCom(Account): __name__ = "DepositfilesCom" __type__ = "account" - __version__ = "0.32" + __version__ = "0.33" __description__ = """Depositfiles.com account plugin""" __license__ = "GPLv3" @@ -23,7 +22,7 @@ class DepositfilesCom(Account): html = req.load("https://dfiles.eu/de/gold/") validuntil = re.search(r"Sie haben Gold Zugang bis: <b>(.*?)</b></div>", html).group(1) - validuntil = mktime(strptime(validuntil, "%Y-%m-%d %H:%M:%S")) + validuntil = time.mktime(time.strptime(validuntil, "%Y-%m-%d %H:%M:%S")) return {"validuntil": validuntil, "trafficleft": -1} diff --git a/module/plugins/accounts/EuroshareEu.py b/module/plugins/accounts/EuroshareEu.py index f92a4e821..b0e87136f 100644 --- a/module/plugins/accounts/EuroshareEu.py +++ b/module/plugins/accounts/EuroshareEu.py @@ -1,15 +1,15 @@ # -*- coding: utf-8 -*- -from time import mktime, strptime import re +import time -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class EuroshareEu(Account): __name__ = "EuroshareEu" __type__ = "account" - __version__ = "0.02" + __version__ = "0.03" __description__ = """Euroshare.eu account plugin""" __license__ = "GPLv3" @@ -25,7 +25,7 @@ class EuroshareEu(Account): premium, validuntil = False, -1 else: premium = True - validuntil = mktime(strptime(m.group(1), "%d.%m.%Y %H:%M")) + validuntil = time.mktime(time.strptime(m.group(1), "%d.%m.%Y %H:%M")) return {"validuntil": validuntil, "trafficleft": -1, "premium": premium} diff --git a/module/plugins/accounts/BillionuploadsCom.py b/module/plugins/accounts/ExashareCom.py index 11af36591..431798522 100644 --- a/module/plugins/accounts/BillionuploadsCom.py +++ b/module/plugins/accounts/ExashareCom.py @@ -3,14 +3,14 @@ from module.plugins.internal.XFSAccount import XFSAccount -class BillionuploadsCom(XFSAccount): - __name__ = "BillionuploadsCom" +class ExashareCom(XFSAccount): + __name__ = "ExashareCom" __type__ = "account" - __version__ = "0.02" + __version__ = "0.01" - __description__ = """Billionuploads.com account plugin""" + __description__ = """Exashare.com account plugin""" __license__ = "GPLv3" __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - HOSTER_DOMAIN = "billionuploads.com" + HOSTER_DOMAIN = "exashare.com" diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index 51be3880f..c83964feb 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- -from module.plugins.Account import Account +from module.plugins.internal.Account import Account from module.common.json_layer import json_loads class FastixRu(Account): __name__ = "FastixRu" __type__ = "account" - __version__ = "0.03" + __version__ = "0.04" __description__ = """Fastix account plugin""" __license__ = "GPLv3" @@ -29,7 +29,7 @@ class FastixRu(Account): def login(self, user, data, req): - html = req.load("http://fastix.ru/api_v2/", + html = req.load("https://fastix.ru/api_v2/", get={'sub': "get_apikey", 'email': user, 'password': data['password']}) api = json_loads(html) diff --git a/module/plugins/accounts/FastshareCz.py b/module/plugins/accounts/FastshareCz.py index d6e94f2e3..e291d5859 100644 --- a/module/plugins/accounts/FastshareCz.py +++ b/module/plugins/accounts/FastshareCz.py @@ -2,13 +2,13 @@ import re -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class FastshareCz(Account): __name__ = "FastshareCz" __type__ = "account" - __version__ = "0.05" + __version__ = "0.07" __description__ = """Fastshare.cz account plugin""" __license__ = "GPLv3" @@ -16,13 +16,13 @@ class FastshareCz(Account): ("stickell", "l.stickell@yahoo.it")] - CREDIT_PATTERN = r'My account\s*\((.+?)\)' + CREDIT_PATTERN = r'Credit\s*:\s*</td>\s*<td>(.+?)\s*<' def loadAccountInfo(self, user, req): - validuntil = None + validuntil = -1 trafficleft = None - premium = None + premium = False html = req.load("http://www.fastshare.cz/user", decode=True) @@ -30,13 +30,11 @@ class FastshareCz(Account): if m: trafficleft = self.parseTraffic(m.group(1)) - if trafficleft: - premium = True - validuntil = -1 - else: - premium = False + premium = bool(trafficleft) - return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium} + return {'validuntil' : validuntil, + 'trafficleft': trafficleft, + 'premium' : premium} def login(self, user, data, req): @@ -44,7 +42,7 @@ class FastshareCz(Account): req.load('http://www.fastshare.cz/login') # Do not remove or it will not login - html = req.load("http://www.fastshare.cz/sql.php", + html = req.load("https://www.fastshare.cz/sql.php", post={'login': user, 'heslo': data['password']}, decode=True) diff --git a/module/plugins/accounts/File4safeCom.py b/module/plugins/accounts/File4SafeCom.py index 50fe1aac8..50fe1aac8 100644 --- a/module/plugins/accounts/File4safeCom.py +++ b/module/plugins/accounts/File4SafeCom.py diff --git a/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py index 8ca55b1bc..c5239405e 100644 --- a/module/plugins/accounts/FilecloudIo.py +++ b/module/plugins/accounts/FilecloudIo.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- -from module.plugins.Account import Account +from module.plugins.internal.Account import Account from module.common.json_layer import json_loads class FilecloudIo(Account): __name__ = "FilecloudIo" __type__ = "account" - __version__ = "0.04" + __version__ = "0.05" __description__ = """FilecloudIo account plugin""" __license__ = "GPLv3" diff --git a/module/plugins/accounts/FilefactoryCom.py b/module/plugins/accounts/FilefactoryCom.py index 426d572db..e56708831 100644 --- a/module/plugins/accounts/FilefactoryCom.py +++ b/module/plugins/accounts/FilefactoryCom.py @@ -1,17 +1,16 @@ # -*- coding: utf-8 -*- +import pycurl import re -from time import mktime, strptime +import time -from pycurl import REFERER - -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class FilefactoryCom(Account): __name__ = "FilefactoryCom" __type__ = "account" - __version__ = "0.15" + __version__ = "0.16" __description__ = """Filefactory.com account plugin""" __license__ = "GPLv3" @@ -29,7 +28,7 @@ class FilefactoryCom(Account): if m: premium = True validuntil = re.sub(self.VALID_UNTIL_PATTERN, '\g<D> \g<M> \g<Y>', m.group(0)) - validuntil = mktime(strptime(validuntil, "%d %b %Y")) + validuntil = time.mktime(time.strptime(validuntil, "%d %b %Y")) else: premium = False validuntil = -1 @@ -38,9 +37,9 @@ class FilefactoryCom(Account): def login(self, user, data, req): - req.http.c.setopt(REFERER, "http://www.filefactory.com/member/login.php") + req.http.c.setopt(pycurl.REFERER, "http://www.filefactory.com/member/login.php") - html = req.load("http://www.filefactory.com/member/signin.php", + html = req.load("https://www.filefactory.com/member/signin.php", post={"loginEmail" : user, "loginPassword": data['password'], "Submit" : "Sign In"}) diff --git a/module/plugins/accounts/FilejungleCom.py b/module/plugins/accounts/FilejungleCom.py index 9f7474207..efeeaceb7 100644 --- a/module/plugins/accounts/FilejungleCom.py +++ b/module/plugins/accounts/FilejungleCom.py @@ -1,15 +1,15 @@ # -*- coding: utf-8 -*- import re -from time import mktime, strptime +import time -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class FilejungleCom(Account): __name__ = "FilejungleCom" __type__ = "account" - __version__ = "0.12" + __version__ = "0.13" __description__ = """Filejungle.com account plugin""" __license__ = "GPLv3" @@ -28,7 +28,7 @@ class FilejungleCom(Account): m = re.search(self.TRAFFIC_LEFT_PATTERN, html) if m: premium = True - validuntil = mktime(strptime(m.group(1), "%d %b %Y")) + validuntil = time.mktime(time.strptime(m.group(1), "%d %b %Y")) else: premium = False validuntil = -1 diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py index 4067445af..f77ac5197 100644 --- a/module/plugins/accounts/FilerNet.py +++ b/module/plugins/accounts/FilerNet.py @@ -3,20 +3,20 @@ import re import time -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class FilerNet(Account): __name__ = "FilerNet" __type__ = "account" - __version__ = "0.04" + __version__ = "0.06" __description__ = """Filer.net account plugin""" __license__ = "GPLv3" __authors__ = [("stickell", "l.stickell@yahoo.it")] - TOKEN_PATTERN = r'_csrf_token" value="([^"]+)" />' + TOKEN_PATTERN = r'name="_csrf_token" value="(.+?)"' WALID_UNTIL_PATTERN = r'Der Premium-Zugang ist gültig bis (.+)\.\s*</td>' TRAFFIC_PATTERN = r'Traffic</th>\s*<td>([^<]+)</td>' FREE_PATTERN = r'Account Status</th>\s*<td>\s*Free' @@ -43,15 +43,15 @@ class FilerNet(Account): def login(self, user, data, req): - html = req.load("https://filer.net/login") + html = req.load("https://filer.net/login", decode=True) token = re.search(self.TOKEN_PATTERN, html).group(1) html = req.load("https://filer.net/login_check", - post={"_username": user, - "_password": data['password'], + post={"_username" : user, + "_password" : data['password'], "_remember_me": "on", - "_csrf_token": token, + "_csrf_token" : token, "_target_path": "https://filer.net/"}, decode=True) diff --git a/module/plugins/accounts/FilesMailRu.py b/module/plugins/accounts/FilesMailRu.py index 15926589e..3f9068fff 100644 --- a/module/plugins/accounts/FilesMailRu.py +++ b/module/plugins/accounts/FilesMailRu.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class FilesMailRu(Account): __name__ = "FilesMailRu" __type__ = "account" - __version__ = "0.11" + __version__ = "0.12" __description__ = """Filesmail.ru account plugin""" __license__ = "GPLv3" @@ -20,12 +20,11 @@ class FilesMailRu(Account): def login(self, user, data, req): user, domain = user.split("@") - html = req.load("http://swa.mail.ru/cgi-bin/auth", + html = req.load("https://swa.mail.ru/cgi-bin/auth", post={"Domain": domain, "Login": user, "Password": data['password'], "Page": "http://files.mail.ru/"}, - cookies=True, decode=True) if "Неверное имя пользователя или пароль" in html: diff --git a/module/plugins/accounts/FileserveCom.py b/module/plugins/accounts/FileserveCom.py index 1cf2a3a3c..38e21e246 100644 --- a/module/plugins/accounts/FileserveCom.py +++ b/module/plugins/accounts/FileserveCom.py @@ -1,15 +1,15 @@ # -*- coding: utf-8 -*- -from time import mktime, strptime +import time -from module.plugins.Account import Account +from module.plugins.internal.Account import Account from module.common.json_layer import json_loads class FileserveCom(Account): __name__ = "FileserveCom" __type__ = "account" - __version__ = "0.20" + __version__ = "0.21" __description__ = """Fileserve.com account plugin""" __license__ = "GPLv3" @@ -24,7 +24,7 @@ class FileserveCom(Account): res = json_loads(html) if res['type'] == "premium": - validuntil = mktime(strptime(res['expireTime'], "%Y-%m-%d %H:%M:%S")) + validuntil = time.mktime(time.strptime(res['expireTime'], "%Y-%m-%d %H:%M:%S")) return {"trafficleft": res['traffic'], "validuntil": validuntil} else: return {"premium": False, "trafficleft": None, "validuntil": None} diff --git a/module/plugins/accounts/FourSharedCom.py b/module/plugins/accounts/FourSharedCom.py index 2777a142a..054f0d3a1 100644 --- a/module/plugins/accounts/FourSharedCom.py +++ b/module/plugins/accounts/FourSharedCom.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class FourSharedCom(Account): __name__ = "FourSharedCom" __type__ = "account" - __version__ = "0.04" + __version__ = "0.05" __description__ = """FourShared.com account plugin""" __license__ = "GPLv3" @@ -22,7 +22,7 @@ class FourSharedCom(Account): def login(self, user, data, req): req.cj.setCookie("4shared.com", "4langcookie", "en") - res = req.load("http://www.4shared.com/web/login", + res = req.load("https://www.4shared.com/web/login", post={'login' : user, 'password' : data['password'], 'remember' : "on", diff --git a/module/plugins/accounts/FreakshareCom.py b/module/plugins/accounts/FreakshareCom.py index 83f4a9a84..83d26fbe5 100644 --- a/module/plugins/accounts/FreakshareCom.py +++ b/module/plugins/accounts/FreakshareCom.py @@ -1,16 +1,15 @@ # -*- coding: utf-8 -*- import re +import time -from time import strptime, mktime - -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class FreakshareCom(Account): __name__ = "FreakshareCom" __type__ = "account" - __version__ = "0.13" + __version__ = "0.14" __description__ = """Freakshare.com account plugin""" __license__ = "GPLv3" @@ -26,7 +25,7 @@ class FreakshareCom(Account): try: m = re.search(r'ltig bis:</td>\s*<td><b>([\d.:-]+)</b></td>', html, re.M) - validuntil = mktime(strptime(m.group(1).strip(), "%d.%m.%Y - %H:%M")) + validuntil = time.mktime(time.strptime(m.group(1).strip(), "%d.%m.%Y - %H:%M")) except Exception: pass @@ -44,9 +43,8 @@ class FreakshareCom(Account): def login(self, user, data, req): req.load("http://freakshare.com/index.php?language=EN") - html = req.load("http://freakshare.com/login.html", + html = req.load("https://freakshare.com/login.html", post={"submit": "Login", "user": user, "pass": data['password']}, - cookies=True, decode=True) if ">Wrong Username or Password" in html: diff --git a/module/plugins/accounts/FreeWayMe.py b/module/plugins/accounts/FreeWayMe.py index 14b9f1e9a..66f93e0bb 100644 --- a/module/plugins/accounts/FreeWayMe.py +++ b/module/plugins/accounts/FreeWayMe.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- -from module.plugins.Account import Account +from module.plugins.internal.Account import Account from module.common.json_layer import json_loads class FreeWayMe(Account): __name__ = "FreeWayMe" __type__ = "account" - __version__ = "0.13" + __version__ = "0.15" __description__ = """FreeWayMe account plugin""" __license__ = "GPLv3" @@ -41,7 +41,7 @@ class FreeWayMe(Account): def getAccountStatus(self, user, req): - answer = req.load("https://www.free-way.me/ajax/jd.php", + answer = req.load("http://www.free-way.bz/ajax/jd.php", #@TODO: Revert to `https` in 0.4.10 get={"id": 4, "user": user, "pass": self.getAccountData(user)['password']}) self.logDebug("Login: %s" % answer) diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py index 66d912958..08d5fe555 100644 --- a/module/plugins/accounts/FshareVn.py +++ b/module/plugins/accounts/FshareVn.py @@ -1,16 +1,15 @@ # -*- coding: utf-8 -*- import re +import time -from time import mktime, strptime - -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class FshareVn(Account): __name__ = "FshareVn" __type__ = "account" - __version__ = "0.09" + __version__ = "0.10" __description__ = """Fshare.vn account plugin""" __license__ = "GPLv3" @@ -19,8 +18,8 @@ class FshareVn(Account): VALID_UNTIL_PATTERN = ur'<dt>Thời hạn dùng:</dt>\s*<dd>([^<]+)</dd>' - LIFETIME_PATTERN = ur'<dt>Lần đăng nhập trước:</dt>\s*<dd>[^<]+</dd>' - TRAFFIC_LEFT_PATTERN = ur'<dt>Tổng Dung Lượng Tài Khoản</dt>\s*<dd[^>]*>([\d.]+) ([kKMG])B</dd>' + LIFETIME_PATTERN = ur'<dt>Lần đăng nhập trước:</dt>\s*<dd>.+?</dd>' + TRAFFIC_LEFT_PATTERN = ur'<dt>Tổng Dung Lượng Tài Khoản</dt>\s*<dd.*?>([\d.]+) ([kKMG])B</dd>' DIRECT_DOWNLOAD_PATTERN = ur'<input type="checkbox"\s*([^=>]*)[^>]*/>Kích hoạt download trực tiếp</dt>' @@ -35,7 +34,7 @@ class FshareVn(Account): m = re.search(self.VALID_UNTIL_PATTERN, html) if m: premium = True - validuntil = mktime(strptime(m.group(1), '%I:%M:%S %p %d-%m-%Y')) + validuntil = time.mktime(time.strptime(m.group(1), '%I:%M:%S %p %d-%m-%Y')) trafficleft = self.getTrafficLeft() else: premium = False diff --git a/module/plugins/accounts/Ftp.py b/module/plugins/accounts/Ftp.py index f978d2fa0..145ba47be 100644 --- a/module/plugins/accounts/Ftp.py +++ b/module/plugins/accounts/Ftp.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class Ftp(Account): __name__ = "Ftp" __type__ = "account" - __version__ = "0.01" + __version__ = "0.02" __description__ = """Ftp dummy account plugin""" __license__ = "GPLv3" diff --git a/module/plugins/accounts/HellshareCz.py b/module/plugins/accounts/HellshareCz.py index e559b28e1..69b4b8443 100644 --- a/module/plugins/accounts/HellshareCz.py +++ b/module/plugins/accounts/HellshareCz.py @@ -3,13 +3,13 @@ import re import time -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class HellshareCz(Account): __name__ = "HellshareCz" __type__ = "account" - __version__ = "0.16" + __version__ = "0.17" __description__ = """Hellshare.cz account plugin""" __license__ = "GPLv3" @@ -68,7 +68,7 @@ class HellshareCz(Account): self.logDebug("Already logged in") return - html = req.load('http://www.hellshare.com/login?do=loginForm-submit', + html = req.load('https://www.hellshare.com/login?do=loginForm-submit', post={"login": "Log in", "password": data['password'], "username": user, diff --git a/module/plugins/accounts/HighWayMe.py b/module/plugins/accounts/HighWayMe.py index 69219a834..eba1b4692 100644 --- a/module/plugins/accounts/HighWayMe.py +++ b/module/plugins/accounts/HighWayMe.py @@ -1,15 +1,15 @@ # -*- coding: utf-8 -*- from module.common.json_layer import json_loads -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class HighWayMe(Account): __name__ = "HighWayMe.py" __type__ = "account" - __version__ = "0.01" + __version__ = "0.03" - __description__ = """High-Way.Me account plugin""" + __description__ = """High-Way.me account plugin""" __license__ = "GPLv3" __authors__ = [("EvolutionClip", "evolutionclip@live.de")] @@ -34,11 +34,12 @@ class HighWayMe(Account): if 'premium_traffic' in json_data['user'] and json_data['user']['premium_traffic']: trafficleft = float(json_data['user']['premium_traffic']) / 1024 #@TODO: Remove `/ 1024` in 0.4.10 - return {"premium": premium, "validuntil": validuntil, "trafficleft": trafficleft} + return {'premium' : premium, + 'validuntil' : validuntil, + 'trafficleft': trafficleft} def login(self, user, data, req): - html = req.load("https://high-way.me/api.php?login", post={'login': '1', 'user': user, 'pass': data['password']}, decode=True) diff --git a/module/plugins/accounts/Http.py b/module/plugins/accounts/Http.py index 07e46eb07..2f12e56d9 100644 --- a/module/plugins/accounts/Http.py +++ b/module/plugins/accounts/Http.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class Http(Account): __name__ = "Http" __type__ = "account" - __version__ = "0.01" + __version__ = "0.02" __description__ = """Http dummy account plugin""" __license__ = "GPLv3" diff --git a/module/plugins/accounts/JunkyvideoCom.py b/module/plugins/accounts/JunkyvideoCom.py new file mode 100644 index 000000000..8275ff176 --- /dev/null +++ b/module/plugins/accounts/JunkyvideoCom.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.XFSAccount import XFSAccount + + +class JunkyvideoCom(XFSAccount): + __name__ = "JunkyvideoCom" + __type__ = "account" + __version__ = "0.01" + + __description__ = """Junkyvideo.com account plugin""" + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + + HOSTER_DOMAIN = "junkyvideo.com" diff --git a/module/plugins/accounts/Keep2shareCc.py b/module/plugins/accounts/Keep2ShareCc.py index e855fb977..8cd23aed6 100644 --- a/module/plugins/accounts/Keep2shareCc.py +++ b/module/plugins/accounts/Keep2ShareCc.py @@ -1,23 +1,23 @@ # -*- coding: utf-8 -*- import re +import time -from time import gmtime, mktime, strptime - -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class Keep2ShareCc(Account): __name__ = "Keep2ShareCc" __type__ = "account" - __version__ = "0.04" + __version__ = "0.06" __description__ = """Keep2Share.cc account plugin""" __license__ = "GPLv3" - __authors__ = [("aeronaut", "aeronaut@pianoguy.de")] + __authors__ = [("aeronaut", "aeronaut@pianoguy.de"), + ("Walter Purcaro", "vuolter@gmail.com")] - VALID_UNTIL_PATTERN = r'Premium expires: <b>(.+?)</b>' + VALID_UNTIL_PATTERN = r'Premium expires:\s*<b>(.+?)<' TRAFFIC_LEFT_PATTERN = r'Available traffic \(today\):\s*<b><a href="/user/statistic.html">(.+?)<' LOGIN_FAIL_PATTERN = r'Please fix the following input errors' @@ -25,8 +25,8 @@ class Keep2ShareCc(Account): def loadAccountInfo(self, user, req): validuntil = None - trafficleft = None - premium = None + trafficleft = -1 + premium = False html = req.load("http://keep2share.cc/site/profile.html", decode=True) @@ -40,25 +40,21 @@ class Keep2ShareCc(Account): validuntil = -1 else: try: - validuntil = mktime(strptime(expiredate, "%Y.%m.%d")) + validuntil = time.mktime(time.strptime(expiredate, "%Y.%m.%d")) except Exception, e: self.logError(e) else: - if validuntil > mktime(gmtime()): - premium = True - else: - premium = False - validuntil = None + premium = True if validuntil > time.mktime(time.gmtime()) else False - m = re.search(self.TRAFFIC_LEFT_PATTERN, html) - if m: - try: - trafficleft = self.parseTraffic(m.group(1)) + m = re.search(self.TRAFFIC_LEFT_PATTERN, html) + if m: + try: + trafficleft = self.parseTraffic(m.group(1)) - except Exception, e: - self.logError(e) + except Exception, e: + self.logError(e) return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} @@ -66,7 +62,7 @@ class Keep2ShareCc(Account): def login(self, user, data, req): req.cj.setCookie("keep2share.cc", "lang", "en") - html = req.load("http://keep2share.cc/login.html", + html = req.load("https://keep2share.cc/login.html", post={'LoginForm[username]' : user, 'LoginForm[password]' : data['password'], 'LoginForm[rememberMe]': 1, diff --git a/module/plugins/accounts/LetitbitNet.py b/module/plugins/accounts/LetitbitNet.py index 7f973d2d3..e5c61e35f 100644 --- a/module/plugins/accounts/LetitbitNet.py +++ b/module/plugins/accounts/LetitbitNet.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- -from module.plugins.Account import Account +from module.plugins.internal.Account import Account # from module.common.json_layer import json_loads, json_dumps class LetitbitNet(Account): __name__ = "LetitbitNet" __type__ = "account" - __version__ = "0.02" + __version__ = "0.03" __description__ = """Letitbit.net account plugin""" __license__ = "GPLv3" diff --git a/module/plugins/accounts/LinksnappyCom.py b/module/plugins/accounts/LinksnappyCom.py index dff28a055..9d5202945 100644 --- a/module/plugins/accounts/LinksnappyCom.py +++ b/module/plugins/accounts/LinksnappyCom.py @@ -1,16 +1,15 @@ # -*- coding: utf-8 -*- -from hashlib import md5 +import hashlib -from module.plugins.Account import Account +from module.plugins.internal.Account import Account from module.common.json_layer import json_loads class LinksnappyCom(Account): __name__ = "LinksnappyCom" __type__ = "account" - __version__ = "0.04" - + __version__ = "0.06" __description__ = """Linksnappy.com account plugin""" __license__ = "GPLv3" __authors__ = [("stickell", "l.stickell@yahoo.it")] @@ -19,7 +18,7 @@ class LinksnappyCom(Account): def loadAccountInfo(self, user, req): data = self.getAccountData(user) r = req.load('http://gen.linksnappy.com/lseAPI.php', - get={'act': 'USERDETAILS', 'username': user, 'password': md5(data['password']).hexdigest()}) + get={'act': 'USERDETAILS', 'username': user, 'password': hashlib.md5(data['password']).hexdigest()}) self.logDebug("JSON data: " + r) @@ -42,16 +41,16 @@ class LinksnappyCom(Account): if 'trafficleft' not in j['return'] or isinstance(j['return']['trafficleft'], str): trafficleft = -1 else: - trafficleft = self.parseTraffic(float(j['return']['trafficleft'] + "MB") + trafficleft = self.parseTraffic("%d MB" % j['return']['trafficleft']) return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft} def login(self, user, data, req): - r = req.load("http://gen.linksnappy.com/lseAPI.php", + r = req.load("https://gen.linksnappy.com/lseAPI.php", get={'act' : 'USERDETAILS', 'username': user, - 'password': md5(data['password']).hexdigest()}, + 'password': hashlib.md5(data['password']).hexdigest()}, decode=True) if 'Invalid Account Details' in r: diff --git a/module/plugins/accounts/MegaDebridEu.py b/module/plugins/accounts/MegaDebridEu.py index a082b97af..fc7a5e5a3 100644 --- a/module/plugins/accounts/MegaDebridEu.py +++ b/module/plugins/accounts/MegaDebridEu.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- -from module.plugins.Account import Account +from module.plugins.internal.Account import Account from module.common.json_layer import json_loads class MegaDebridEu(Account): __name__ = "MegaDebridEu" __type__ = "account" - __version__ = "0.20" + __version__ = "0.21" __description__ = """mega-debrid.eu account plugin""" __license__ = "GPLv3" diff --git a/module/plugins/accounts/MegaRapidCz.py b/module/plugins/accounts/MegaRapidCz.py index b229fe47d..ffb0024ca 100644 --- a/module/plugins/accounts/MegaRapidCz.py +++ b/module/plugins/accounts/MegaRapidCz.py @@ -1,15 +1,15 @@ # -*- coding: utf-8 -*- import re +import time -from time import mktime, strptime -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class MegaRapidCz(Account): __name__ = "MegaRapidCz" __type__ = "account" - __version__ = "0.35" + __version__ = "0.36" __description__ = """MegaRapid.cz account plugin""" __license__ = "GPLv3" @@ -34,7 +34,7 @@ class MegaRapidCz(Account): m = re.search(self.VALID_UNTIL_PATTERN, htmll) if m: - validuntil = mktime(strptime(m.group(1), "%d.%m.%Y - %H:%M")) + validuntil = time.mktime(time.strptime(m.group(1), "%d.%m.%Y - %H:%M")) return {"premium": True, "trafficleft": -1, "validuntil": validuntil} m = re.search(self.TRAFFIC_LEFT_PATTERN, htmll) @@ -52,7 +52,7 @@ class MegaRapidCz(Account): start = html.index('id="inp_hash" name="hash" value="') html = html[start + 33:] hashes = html[0:32] - html = req.load("http://megarapid.cz/prihlaseni/", + html = req.load("https://megarapid.cz/prihlaseni/", post={"hash": hashes, "login": user, "pass1": data['password'], diff --git a/module/plugins/accounts/MegaRapidoNet.py b/module/plugins/accounts/MegaRapidoNet.py new file mode 100644 index 000000000..93afd3578 --- /dev/null +++ b/module/plugins/accounts/MegaRapidoNet.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- + +import re +import time + +from module.plugins.internal.Account import Account + + +class MegaRapidoNet(Account): + __name__ = "MegaRapidoNet" + __type__ = "account" + __version__ = "0.03" + + __description__ = """MegaRapido.net account plugin""" + __license__ = "GPLv3" + __authors__ = [("Kagenoshin", "kagenoshin@gmx.ch")] + + + VALID_UNTIL_PATTERN = r'<\s*?div[^>]*?class\s*?=\s*?[\'"]premium_index[\'"].*?>[^<]*?<[^>]*?b.*?>\s*?TEMPO\s*?PREMIUM.*?<[^>]*?/b.*?>\s*?(\d*)[^\d]*?DIAS[^\d]*?(\d*)[^\d]*?HORAS[^\d]*?(\d*)[^\d]*?MINUTOS[^\d]*?(\d*)[^\d]*?SEGUNDOS' + USER_ID_PATTERN = r'<\s*?div[^>]*?class\s*?=\s*?["\']checkbox_compartilhar["\'].*?>.*?<\s*?input[^>]*?name\s*?=\s*?["\']usar["\'].*?>.*?<\s*?input[^>]*?name\s*?=\s*?["\']user["\'][^>]*?value\s*?=\s*?["\'](.*?)\s*?["\']' + + + def loadAccountInfo(self, user, req): + validuntil = None + trafficleft = None + premium = False + + html = req.load("http://megarapido.net/gerador", decode=True) + + validuntil = re.search(self.VALID_UNTIL_PATTERN, html) + if validuntil: + #hier weitermachen!!! (müssen umbedingt die zeit richtig machen damit! (sollte aber möglich)) + validuntil = time.time() + int(validuntil.group(1)) * 24 * 3600 + int(validuntil.group(2)) * 3600 + int(validuntil.group(3)) * 60 + int(validuntil.group(4)) + trafficleft = -1 + premium = True + + return {'validuntil' : validuntil, + 'trafficleft': trafficleft, + 'premium' : premium} + + + def login(self, user, data, req): + req.load("http://megarapido.net/login") + req.load("http://megarapido.net/painel_user/ajax/logar.php", + post={'login': user, 'senha': data['password']}, + decode=True) + + html = req.load("http://megarapido.net/gerador") + + if "sair" not in html.lower(): + self.wrongPassword() + else: + m = re.search(self.USER_ID_PATTERN, html) + if m: + data['uid'] = m.group(1) + else: + self.fail("Couldn't find the user ID") diff --git a/module/plugins/accounts/MegasharesCom.py b/module/plugins/accounts/MegasharesCom.py index 127ebadc8..d9ef7abb9 100644 --- a/module/plugins/accounts/MegasharesCom.py +++ b/module/plugins/accounts/MegasharesCom.py @@ -1,15 +1,15 @@ # -*- coding: utf-8 -*- import re -from time import mktime, strptime +import time -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class MegasharesCom(Account): __name__ = "MegasharesCom" __type__ = "account" - __version__ = "0.03" + __version__ = "0.04" __description__ = """Megashares.com account plugin""" __license__ = "GPLv3" @@ -29,7 +29,7 @@ class MegasharesCom(Account): try: timestr = re.search(self.VALID_UNTIL_PATTERN, html).group(1) self.logDebug(timestr) - validuntil = mktime(strptime(timestr, "%b %d, %Y")) + validuntil = time.mktime(time.strptime(timestr, "%b %d, %Y")) except Exception, e: self.logError(e) diff --git a/module/plugins/accounts/MultishareCz.py b/module/plugins/accounts/MultishareCz.py index 0ac764ee1..df498e6a6 100644 --- a/module/plugins/accounts/MultishareCz.py +++ b/module/plugins/accounts/MultishareCz.py @@ -2,13 +2,13 @@ import re -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class MultishareCz(Account): __name__ = "MultishareCz" __type__ = "account" - __version__ = "0.05" + __version__ = "0.06" __description__ = """Multishare.cz account plugin""" __license__ = "GPLv3" @@ -16,7 +16,7 @@ class MultishareCz(Account): TRAFFIC_LEFT_PATTERN = r'<span class="profil-zvyrazneni">Kredit:</span>\s*<strong>(?P<S>[\d.,]+) (?P<U>[\w^_]+)</strong>' - ACCOUNT_INFO_PATTERN = r'<input type="hidden" id="(u_ID|u_hash)" name="[^"]*" value="([^"]+)">' + ACCOUNT_INFO_PATTERN = r'<input type="hidden" id="(u_ID|u_hash)" name=".+?" value="(.+?)">' def loadAccountInfo(self, user, req): @@ -34,7 +34,7 @@ class MultishareCz(Account): def login(self, user, data, req): - html = req.load('http://www.multishare.cz/html/prihlaseni_process.php', + html = req.load('https://www.multishare.cz/html/prihlaseni_process.php', post={"akce" : "Přihlásit", "heslo": data['password'], "jmeno": user}, diff --git a/module/plugins/accounts/MyfastfileCom.py b/module/plugins/accounts/MyfastfileCom.py index 4c75b27f0..00de6d959 100644 --- a/module/plugins/accounts/MyfastfileCom.py +++ b/module/plugins/accounts/MyfastfileCom.py @@ -1,15 +1,15 @@ # -*- coding: utf-8 -*- -from time import time +import time from module.common.json_layer import json_loads -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class MyfastfileCom(Account): __name__ = "MyfastfileCom" __type__ = "account" - __version__ = "0.04" + __version__ = "0.05" __description__ = """Myfastfile.com account plugin""" __license__ = "GPLv3" @@ -18,7 +18,7 @@ class MyfastfileCom(Account): def loadAccountInfo(self, user, req): if 'days_left' in self.json_data: - validuntil = time() + self.json_data['days_left'] * 24 * 60 * 60 + validuntil = time.time() + self.json_data['days_left'] * 24 * 60 * 60 return {"premium": True, "validuntil": validuntil, "trafficleft": -1} else: self.logError(_("Unable to get account information")) @@ -26,7 +26,7 @@ class MyfastfileCom(Account): def login(self, user, data, req): # Password to use is the API-Password written in http://myfastfile.com/myaccount - html = req.load("http://myfastfile.com/api.php", + html = req.load("https://myfastfile.com/api.php", get={"user": user, "pass": data['password']}) self.logDebug("JSON data: " + html) diff --git a/module/plugins/accounts/NetloadIn.py b/module/plugins/accounts/NetloadIn.py deleted file mode 100755 index 1abd7fa84..000000000 --- a/module/plugins/accounts/NetloadIn.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- - -import re -from time import time - -from module.plugins.Account import Account - - -class NetloadIn(Account): - __name__ = "NetloadIn" - __type__ = "account" - __version__ = "0.23" - - __description__ = """Netload.in account plugin""" - __license__ = "GPLv3" - __authors__ = [("RaNaN", "RaNaN@pyload.org"), - ("CryNickSystems", "webmaster@pcProfil.de")] - - - def loadAccountInfo(self, user, req): - html = req.load("http://netload.in/index.php", get={'id': 2, 'lang': "de"}) - left = r'>(\d+) (Tag|Tage), (\d+) Stunden<' - left = re.search(left, html) - if left: - validuntil = time() + int(left.group(1)) * 24 * 60 * 60 + int(left.group(3)) * 60 * 60 - trafficleft = -1 - premium = True - else: - validuntil = None - premium = False - trafficleft = None - return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium} - - - def login(self, user, data, req): - html = req.load("http://netload.in/index.php", - post={"txtuser" : user, - "txtpass" : data['password'], - "txtcheck": "login", - "txtlogin": "Login"}, - cookies=True, - decode=True) - if "password or it might be invalid!" in html: - self.wrongPassword() diff --git a/module/plugins/accounts/NitroflareCom.py b/module/plugins/accounts/NitroflareCom.py new file mode 100644 index 000000000..0397b113d --- /dev/null +++ b/module/plugins/accounts/NitroflareCom.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- + +import re +import time + +from module.plugins.internal.Account import Account + + +class NitroflareCom(Account): + __name__ = "NitroflareCom" + __type__ = "account" + __version__ = "0.05" + + __description__ = """Nitroflare.com account plugin""" + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com" )] + + + VALID_UNTIL_PATTERN = r'>Time Left</label><strong>(.+?)</' + TRAFFIC_LEFT_PATTERN = r'>Daily Limit</label><strong>([\d.,]+)' + LOGIN_FAIL_PATTERN = r'<ul class="errors">\s*<li>' + + TOKEN_PATTERN = r'name="token" value="(.+?)"' + + + def loadAccountInfo(self, user, req): + validuntil = -1 + trafficleft = None + premium = False + + html = req.load("https://nitroflare.com/member", + get={'s': "premium"}, + decode=True) + + m = re.search(self.VALID_UNTIL_PATTERN, html) + if m: + expiredate = m.group(1).strip() + self.logDebug("Time Left: " + expiredate) + + try: + validuntil = sum(int(v) * {'day': 24 * 3600, 'hour': 3600, 'minute': 60}[u.lower()] for v, u in + re.findall(r'(\d+)\s*(day|hour|minute)', expiredate, re.I)) + except Exception, e: + self.logError(e) + + else: + self.logDebug("Valid until: %s" % validuntil) + + if validuntil: + validuntil += time.time() + premium = True + else: + validuntil = -1 + + m = re.search(self.TRAFFIC_LEFT_PATTERN, html) + if m: + try: + trafficleft = self.parseTraffic(str(max(0, 50 - float(m.group(1)))) + " GB") + + except Exception, e: + self.logError(e) + else: + self.logDebug("TRAFFIC_LEFT_PATTERN not found") + + return {'validuntil' : validuntil, + 'trafficleft': trafficleft, + 'premium' : premium} + + + def login(self, user, data, req): + html = req.load("https://nitroflare.com/login", decode=True) + + token = re.search(self.TOKEN_PATTERN, html).group(1) + + html = req.load("https://nitroflare.com/login", + post={'login' : "", + 'email' : user, + 'password': data['password'], + 'token' : token}, + decode=True) + + if re.search(self.LOGIN_FAIL_PATTERN, html): + self.wrongPassword() diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index f2223b7d9..4944ad4df 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -1,41 +1,41 @@ # -*- coding: utf-8 -*- -from datetime import datetime +import datetime import hashlib +import time -from module.plugins.Account import Account -from time import mktime -from module.common.json_layer import json_loads as loads +from module.common.json_layer import json_loads +from module.plugins.internal.Account import Account class NoPremiumPl(Account): - __name__ = "NoPremiumPl" - __version__ = "0.01" - __type__ = "account" + __name__ = "NoPremiumPl" + __type__ = "account" + __version__ = "0.02" + __description__ = "NoPremium.pl account plugin" - __license__ = "GPLv3" - __authors__ = [("goddie", "dev@nopremium.pl")] + __license__ = "GPLv3" + __authors__ = [("goddie", "dev@nopremium.pl")] - _api_url = "http://crypt.nopremium.pl" - _api_query = { - "site": "nopremium", - "username": "", - "password": "", - "output": "json", - "loc": "1", - "info": "1" - } + API_URL = "http://crypt.nopremium.pl" + API_QUERY = {'site' : "nopremium", + 'username': "" , + 'password': "" , + 'output' : "json" , + 'loc' : "1" , + 'info' : "1" } _req = None _usr = None _pwd = None + def loadAccountInfo(self, name, req): self._req = req try: - result = loads(self.runAuthQuery()) - except: + result = json_loads(self.runAuthQuery()) + except Exception: # todo: return or let it be thrown? return @@ -44,14 +44,14 @@ class NoPremiumPl(Account): if "expire" in result.keys() and result["expire"]: premium = True - valid_untill = mktime(datetime.fromtimestamp(int(result["expire"])).timetuple()) + valid_untill = time.mktime(datetime.datetime.fromtimestamp(int(result["expire"])).timetuple()) + traffic_left = result["balance"] * 1024 - return ({ - "validuntil": valid_untill, - "trafficleft": traffic_left, - "premium": premium - }) + return {'validuntil' : valid_untill, + 'trafficleft': traffic_left, + 'premium' : premium } + def login(self, user, data, req): self._usr = user @@ -59,23 +59,23 @@ class NoPremiumPl(Account): self._req = req try: - response = loads(self.runAuthQuery()) - except: + response = json_loads(self.runAuthQuery()) + except Exception: self.wrongPassword() if "errno" in response.keys(): self.wrongPassword() + data['usr'] = self._usr data['pwd'] = self._pwd + def createAuthQuery(self): - query = self._api_query + query = self.API_QUERY query["username"] = self._usr query["password"] = self._pwd - return query - def runAuthQuery(self): - data = self._req.load(self._api_url, post=self.createAuthQuery()) - return data
\ No newline at end of file + def runAuthQuery(self): + return self._req.load(self.API_URL, post=self.createAuthQuery()) diff --git a/module/plugins/accounts/NowVideoSx.py b/module/plugins/accounts/NowVideoSx.py index f44ae3865..a0cc90790 100644 --- a/module/plugins/accounts/NowVideoSx.py +++ b/module/plugins/accounts/NowVideoSx.py @@ -1,16 +1,15 @@ # -*- coding: utf-8 -*- import re +import time -from time import gmtime, mktime, strptime - -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class NowVideoSx(Account): __name__ = "NowVideoSx" __type__ = "account" - __version__ = "0.03" + __version__ = "0.04" __description__ = """NowVideo.at account plugin""" __license__ = "GPLv3" @@ -33,13 +32,13 @@ class NowVideoSx(Account): self.logDebug("Expire date: " + expiredate) try: - validuntil = mktime(strptime(expiredate, "%Y-%b-%d")) + validuntil = time.mktime(time.strptime(expiredate, "%Y-%b-%d")) except Exception, e: self.logError(e) else: - if validuntil > mktime(gmtime()): + if validuntil > time.mktime(time.gmtime()): premium = True else: premium = False diff --git a/module/plugins/accounts/OboomCom.py b/module/plugins/accounts/OboomCom.py index 0acacbb2a..b1217cff5 100644 --- a/module/plugins/accounts/OboomCom.py +++ b/module/plugins/accounts/OboomCom.py @@ -1,17 +1,29 @@ # -*- coding: utf-8 -*- -import time +try: + from beaker.crypto.pbkdf2 import PBKDF2 -from beaker.crypto.pbkdf2 import PBKDF2 +except ImportError: + from beaker.crypto.pbkdf2 import pbkdf2 + from binascii import b2a_hex + + class PBKDF2(object): + def __init__(self, passphrase, salt, iterations=1000): + self.passphrase = passphrase + self.salt = salt + self.iterations = iterations + + def hexread(self, octets): + return b2a_hex(pbkdf2(self.passphrase, self.salt, self.iterations, octets)) from module.common.json_layer import json_loads -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class OboomCom(Account): __name__ = "OboomCom" __type__ = "account" - __version__ = "0.23" + __version__ = "0.25" __description__ = """Oboom.com account plugin""" __license__ = "GPLv3" diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py index 1fc8d994d..a9c6829b1 100644 --- a/module/plugins/accounts/OneFichierCom.py +++ b/module/plugins/accounts/OneFichierCom.py @@ -1,18 +1,16 @@ # -*- coding: utf-8 -*- +import pycurl import re +import time -from time import strptime, mktime - -from pycurl import REFERER - -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class OneFichierCom(Account): __name__ = "OneFichierCom" __type__ = "account" - __version__ = "0.12" + __version__ = "0.13" __description__ = """1fichier.com account plugin""" __license__ = "GPLv3" @@ -36,7 +34,7 @@ class OneFichierCom(Account): self.logDebug("Expire date: " + expiredate) try: - validuntil = mktime(strptime(expiredate, "%d/%m/%Y")) + validuntil = time.mktime(time.strptime(expiredate, "%d/%m/%Y")) except Exception, e: self.logError(e) else: @@ -46,7 +44,7 @@ class OneFichierCom(Account): def login(self, user, data, req): - req.http.c.setopt(REFERER, "https://1fichier.com/login.pl?lg=en") + req.http.c.setopt(pycurl.REFERER, "https://1fichier.com/login.pl?lg=en") html = req.load("https://1fichier.com/login.pl?lg=en", post={'mail' : user, diff --git a/module/plugins/accounts/OverLoadMe.py b/module/plugins/accounts/OverLoadMe.py index d59944e63..82f4d9240 100644 --- a/module/plugins/accounts/OverLoadMe.py +++ b/module/plugins/accounts/OverLoadMe.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- -from module.plugins.Account import Account +from module.plugins.internal.Account import Account from module.common.json_layer import json_loads class OverLoadMe(Account): __name__ = "OverLoadMe" __type__ = "account" - __version__ = "0.04" + __version__ = "0.05" __description__ = """Over-Load.me account plugin""" __license__ = "GPLv3" @@ -15,9 +15,8 @@ class OverLoadMe(Account): def loadAccountInfo(self, user, req): - https = "https" if self.getConfig("ssl") else "http" data = self.getAccountData(user) - html = req.load(https + "://api.over-load.me/account.php", + html = req.load("https://api.over-load.me/account.php", get={'user': user, 'auth': data['password']}).strip() @@ -32,8 +31,7 @@ class OverLoadMe(Account): def login(self, user, data, req): - https = "https" if self.getConfig("ssl") else "http" - jsondata = req.load(https + "://api.over-load.me/account.php", + jsondata = req.load("https://api.over-load.me/account.php", get={'user': user, 'auth': data['password']}).strip() diff --git a/module/plugins/accounts/PremiumTo.py b/module/plugins/accounts/PremiumTo.py index c8ea2fa26..322225d36 100644 --- a/module/plugins/accounts/PremiumTo.py +++ b/module/plugins/accounts/PremiumTo.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class PremiumTo(Account): __name__ = "PremiumTo" __type__ = "account" - __version__ = "0.08" + __version__ = "0.10" __description__ = """Premium.to account plugin""" __license__ = "GPLv3" @@ -16,7 +16,7 @@ class PremiumTo(Account): def loadAccountInfo(self, user, req): - traffic = req.load("http://premium.to/api/straffic.php", + traffic = req.load("http://premium.to/api/straffic.php", #@TODO: Revert to `https` in 0.4.10 get={'username': self.username, 'password': self.password}) if "wrong username" not in traffic: @@ -29,7 +29,7 @@ class PremiumTo(Account): def login(self, user, data, req): self.username = user self.password = data['password'] - authcode = req.load("http://premium.to/api/getauthcode.php", + authcode = req.load("http://premium.to/api/getauthcode.php", #@TODO: Revert to `https` in 0.4.10 get={'username': user, 'password': self.password}, decode=True) diff --git a/module/plugins/accounts/PremiumizeMe.py b/module/plugins/accounts/PremiumizeMe.py index 7d061ec2d..5112bceb6 100644 --- a/module/plugins/accounts/PremiumizeMe.py +++ b/module/plugins/accounts/PremiumizeMe.py @@ -1,14 +1,13 @@ # -*- coding: utf-8 -*- -from module.plugins.Account import Account - from module.common.json_layer import json_loads +from module.plugins.internal.Account import Account class PremiumizeMe(Account): __name__ = "PremiumizeMe" __type__ = "account" - __version__ = "0.13" + __version__ = "0.17" __description__ = """Premiumize.me account plugin""" __license__ = "GPLv3" @@ -42,7 +41,7 @@ class PremiumizeMe(Account): def getAccountStatus(self, user, req): # Use premiumize.me API v1 (see https://secure.premiumize.me/?show=api) # to retrieve account info and return the parsed json answer - answer = req.load("https://api.premiumize.me/pm-api/v1.php", + answer = req.load("http://api.premiumize.me/pm-api/v1.php", #@TODO: Revert to `https` in 0.4.10 get={'method' : "accountstatus", 'params[login]': user, 'params[pass]' : self.getAccountData(user)['password']}) diff --git a/module/plugins/accounts/QuickshareCz.py b/module/plugins/accounts/QuickshareCz.py index 16141d63e..0e52d5f79 100644 --- a/module/plugins/accounts/QuickshareCz.py +++ b/module/plugins/accounts/QuickshareCz.py @@ -2,13 +2,13 @@ import re -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class QuickshareCz(Account): __name__ = "QuickshareCz" __type__ = "account" - __version__ = "0.03" + __version__ = "0.04" __description__ = """Quickshare.cz account plugin""" __license__ = "GPLv3" diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py index 829e54a46..b188a34d9 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- -from module.plugins.Account import Account +from module.plugins.internal.Account import Account from module.common.json_layer import json_loads class RPNetBiz(Account): __name__ = "RPNetBiz" __type__ = "account" - __version__ = "0.12" + __version__ = "0.13" __description__ = """RPNet.biz account plugin""" __license__ = "GPLv3" diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index 438ce7ad3..5039d1494 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -1,80 +1,81 @@ # -*- coding: utf-8 -*- -from datetime import datetime +import datetime import hashlib +import time -from module.plugins.Account import Account -from time import mktime -from module.common.json_layer import json_loads as loads +from module.common.json_layer import json_loads +from module.plugins.internal.Account import Account class RapideoPl(Account): - __name__ = "RapideoPl" - __version__ = "0.01" - __type__ = "account" + __name__ = "RapideoPl" + __type__ = "account" + __version__ = "0.02" + __description__ = "Rapideo.pl account plugin" - __license__ = "GPLv3" - __authors__ = [("goddie", "dev@rapideo.pl")] + __license__ = "GPLv3" + __authors__ = [("goddie", "dev@rapideo.pl")] - _api_url = "http://enc.rapideo.pl" - _api_query = { - "site": "newrd", - "username": "", - "password": "", - "output": "json", - "loc": "1", - "info": "1" - } + API_URL = "http://enc.rapideo.pl" + API_QUERY = {'site' : "newrd", + 'username': "" , + 'password': "" , + 'output' : "json" , + 'loc' : "1" , + 'info' : "1" } _req = None _usr = None _pwd = None + def loadAccountInfo(self, name, req): self._req = req try: - result = loads(self.runAuthQuery()) - except: + result = json_loads(self.runAuthQuery()) + except Exception: # todo: return or let it be thrown? return premium = False valid_untill = -1 + if "expire" in result.keys() and result["expire"]: premium = True - valid_untill = mktime(datetime.fromtimestamp(int(result["expire"])).timetuple()) + valid_untill = time.mktime(datetime.datetime.fromtimestamp(int(result["expire"])).timetuple()) traffic_left = result["balance"] - return ({ - "validuntil": valid_untill, - "trafficleft": traffic_left, - "premium": premium - }) + return {'validuntil' : valid_untill, + 'trafficleft': traffic_left, + 'premium' : premium } + def login(self, user, data, req): self._usr = user self._pwd = hashlib.md5(data["password"]).hexdigest() self._req = req + try: - response = loads(self.runAuthQuery()) - except: + response = json_loads(self.runAuthQuery()) + except Exception: self.wrongPassword() if "errno" in response.keys(): self.wrongPassword() + data['usr'] = self._usr data['pwd'] = self._pwd + def createAuthQuery(self): - query = self._api_query + query = self.API_QUERY query["username"] = self._usr query["password"] = self._pwd - return query - def runAuthQuery(self): - data = self._req.load(self._api_url, post=self.createAuthQuery()) - return data
\ No newline at end of file + def runAuthQuery(self): + return self._req.load(self.API_URL, post=self.createAuthQuery()) diff --git a/module/plugins/accounts/RapidgatorNet.py b/module/plugins/accounts/RapidgatorNet.py index b29d94228..94692da76 100644 --- a/module/plugins/accounts/RapidgatorNet.py +++ b/module/plugins/accounts/RapidgatorNet.py @@ -1,56 +1,67 @@ # -*- coding: utf-8 -*- -from module.plugins.Account import Account +from module.plugins.internal.Account import Account from module.common.json_layer import json_loads class RapidgatorNet(Account): __name__ = "RapidgatorNet" __type__ = "account" - __version__ = "0.06" + __version__ = "0.10" __description__ = """Rapidgator.net account plugin""" __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - API_URL = 'http://rapidgator.net/api/user' + API_URL = "http://rapidgator.net/api/user" def loadAccountInfo(self, user, req): + validuntil = None + trafficleft = None + premium = False + sid = None + try: - sid = self.getAccountData(user).get('SID') + sid = self.getAccountData(user).get('sid', None) assert sid - json = req.load("%s/info?sid=%s" % (self.API_URL, sid)) - self.logDebug("API:USERINFO", json) - json = json_loads(json) + html = req.load("%s/info" % self.API_URL, get={'sid': sid}) + + self.logDebug("API:USERINFO", html) + + json = json_loads(html) if json['response_status'] == 200: if "reset_in" in json['response']: self.scheduleRefresh(user, json['response']['reset_in']) - return {"validuntil": json['response']['expire_date'], - "trafficleft": float(json['response']['traffic_left']) / 1024, #@TODO: Remove `/ 1024` in 0.4.10 - "premium": True} + validuntil = json['response']['expire_date'] + trafficleft = float(json['response']['traffic_left']) / 1024 #@TODO: Remove `/ 1024` in 0.4.10 + premium = True else: self.logError(json['response_details']) + except Exception, e: self.logError(e) - return {"validuntil": None, "trafficleft": None, "premium": False} + return {'validuntil' : validuntil, + 'trafficleft': trafficleft, + 'premium' : premium, + 'sid' : sid} def login(self, user, data, req): try: - json = req.load('%s/login' % self.API_URL, post={"username": user, "password": data['password']}) + html = req.load('%s/login' % self.API_URL, post={"username": user, "password": data['password']}) - self.logDebug("API:LOGIN", json) + self.logDebug("API:LOGIN", html) - json = json_loads(json) + json = json_loads(html) if json['response_status'] == 200: - data['SID'] = str(json['response']['session_id']) + data['sid'] = str(json['response']['session_id']) return else: self.logError(json['response_details']) diff --git a/module/plugins/accounts/RapiduNet.py b/module/plugins/accounts/RapiduNet.py index 8da698c57..a158e9ce2 100644 --- a/module/plugins/accounts/RapiduNet.py +++ b/module/plugins/accounts/RapiduNet.py @@ -1,17 +1,16 @@ # -*- coding: utf-8 -*- import re +import time -from time import time - -from module.plugins.Account import Account +from module.plugins.internal.Account import Account from module.common.json_layer import json_loads class RapiduNet(Account): __name__ = "RapiduNet" __type__ = "account" - __version__ = "0.05" + __version__ = "0.06" __description__ = """Rapidu.net account plugin""" __license__ = "GPLv3" @@ -38,7 +37,7 @@ class RapiduNet(Account): m = re.search(self.VALID_UNTIL_PATTERN, html) if m: - validuntil = time() + (86400 * int(m.group(1))) + validuntil = time.time() + (86400 * int(m.group(1))) m = re.search(self.TRAFFIC_LEFT_PATTERN, html) if m: diff --git a/module/plugins/accounts/RealdebridCom.py b/module/plugins/accounts/RealdebridCom.py index 41d8a0975..a4bd52062 100644 --- a/module/plugins/accounts/RealdebridCom.py +++ b/module/plugins/accounts/RealdebridCom.py @@ -1,14 +1,14 @@ # -*- coding: utf-8 -*- -import xml.dom.minidom as dom +import xml.dom.minidom -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class RealdebridCom(Account): __name__ = "RealdebridCom" __type__ = "account" - __version__ = "0.45" + __version__ = "0.46" __description__ = """Real-Debrid.com account plugin""" __license__ = "GPLv3" @@ -19,7 +19,7 @@ class RealdebridCom(Account): if self.pin_code: return {"premium": False} html = req.load("https://real-debrid.com/api/account.php") - xml = dom.parseString(html) + xml = xml.dom.minidom.parseString(html) account_info = {"validuntil": float(xml.getElementsByTagName("expiration")[0].childNodes[0].nodeValue), "trafficleft": -1} diff --git a/module/plugins/accounts/RehostTo.py b/module/plugins/accounts/RehostTo.py index 897f888b0..728b2e84e 100644 --- a/module/plugins/accounts/RehostTo.py +++ b/module/plugins/accounts/RehostTo.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class RehostTo(Account): __name__ = "RehostTo" __type__ = "account" - __version__ = "0.16" + __version__ = "0.17" __description__ = """Rehost.to account plugin""" __license__ = "GPLv3" @@ -18,13 +18,13 @@ class RehostTo(Account): trafficleft = None validuntil = -1 session = "" - - html = req.load("http://rehost.to/api.php", + + html = req.load("https://rehost.to/api.php", get={'cmd' : "login", 'user': user, 'pass': self.getAccountData(user)['password']}) try: session = html.split(",")[1].split("=")[1] - + html = req.load("http://rehost.to/api.php", get={'cmd': "get_premium_credits", 'long_ses': session}) @@ -32,11 +32,11 @@ class RehostTo(Account): self.logDebug(html) else: traffic, valid = html.split(",") - + premium = True trafficleft = self.parseTraffic(traffic + "MB") validuntil = float(valid) - + finally: return {'premium' : premium, 'trafficleft': trafficleft, @@ -45,7 +45,7 @@ class RehostTo(Account): def login(self, user, data, req): - html = req.load("http://rehost.to/api.php", + html = req.load("https://rehost.to/api.php", get={'cmd': "login", 'user': user, 'pass': data['password']}, decode=True) diff --git a/module/plugins/accounts/SharebeastCom.py b/module/plugins/accounts/SharebeastCom.py new file mode 100644 index 000000000..d233ffd37 --- /dev/null +++ b/module/plugins/accounts/SharebeastCom.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.XFSAccount import XFSAccount + + +class SharebeastCom(XFSAccount): + __name__ = "SharebeastCom" + __type__ = "account" + __version__ = "0.01" + + __description__ = """Sharebeast.com account plugin""" + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + + HOSTER_DOMAIN = "sharebeast.com" diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 3ee6e04af..9269cf2a1 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -2,13 +2,13 @@ import re -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class ShareonlineBiz(Account): __name__ = "ShareonlineBiz" __type__ = "account" - __version__ = "0.30" + __version__ = "0.34" __description__ = """Share-online.biz account plugin""" __license__ = "GPLv3" @@ -40,23 +40,29 @@ class ShareonlineBiz(Account): if api['a'].lower() != "not_available": req.cj.setCookie("share-online.biz", 'a', api['a']) - premium = api['group'] == "Premium" + premium = api['group'] in ("PrePaid", "Premium", "Penalty-Premium") validuntil = float(api['expire_date']) traffic = float(api['traffic_1d'].split(";")[0]) - maxtraffic = max(maxtraffic, traffic) - trafficleft = maxtraffic - traffic + + if maxtraffic > traffic: + trafficleft = maxtraffic - traffic + else: + trafficleft = -1 maxtraffic /= 1024 #@TODO: Remove `/ 1024` in 0.4.10 trafficleft /= 1024 #@TODO: Remove `/ 1024` in 0.4.10 - return {'premium': premium, 'validuntil': validuntil, 'trafficleft': trafficleft, 'maxtraffic': maxtraffic} + return {'premium' : premium, + 'validuntil' : validuntil, + 'trafficleft': trafficleft, + 'maxtraffic' : maxtraffic} def login(self, user, data, req): html = self.api_response(user, req) err = re.search(r'\*\*(.+?)\*\*', html) if err: - self.logError(err.group(1)) + self.logError(err.group(1).strip()) self.wrongPassword() diff --git a/module/plugins/accounts/SimplyPremiumCom.py b/module/plugins/accounts/SimplyPremiumCom.py index 79daf245e..5c87cbbfb 100644 --- a/module/plugins/accounts/SimplyPremiumCom.py +++ b/module/plugins/accounts/SimplyPremiumCom.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- from module.common.json_layer import json_loads -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class SimplyPremiumCom(Account): __name__ = "SimplyPremiumCom" __type__ = "account" - __version__ = "0.04" + __version__ = "0.06" __description__ = """Simply-Premium.com account plugin""" __license__ = "GPLv3" @@ -15,15 +15,18 @@ class SimplyPremiumCom(Account): def loadAccountInfo(self, user, req): + premium = False validuntil = -1 trafficleft = None json_data = req.load('http://www.simply-premium.com/api/user.php?format=json') - self.logDebug("JSON data: " + json_data) + + self.logDebug("JSON data: %s" % json_data) + json_data = json_loads(json_data) - if 'vip' in json_data['result'] and json_data['result']['vip'] == 0: - return {"premium": False} + if 'vip' in json_data['result'] and json_data['result']['vip']: + premium = True if 'timeend' in json_data['result'] and json_data['result']['timeend']: validuntil = float(json_data['result']['timeend']) @@ -31,18 +34,15 @@ class SimplyPremiumCom(Account): if 'remain_traffic' in json_data['result'] and json_data['result']['remain_traffic']: trafficleft = float(json_data['result']['remain_traffic']) / 1024 #@TODO: Remove `/ 1024` in 0.4.10 - return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft} + return {"premium": premium, "validuntil": validuntil, "trafficleft": trafficleft} def login(self, user, data, req): req.cj.setCookie("simply-premium.com", "lang", "EN") - if data['password'] == '' or data['password'] == '0': - post_data = {"key": user} - else: - post_data = {"login_name": user, "login_pass": data['password']} - - html = req.load("http://www.simply-premium.com/login.php", post=post_data, decode=True) + html = req.load("https://www.simply-premium.com/login.php", + post={'key': user} if not data['password'] else {'login_name': user, 'login_pass': data['password']}, + decode=True) if 'logout' not in html: self.wrongPassword() diff --git a/module/plugins/accounts/SimplydebridCom.py b/module/plugins/accounts/SimplydebridCom.py index 29be2f73d..97b2b8ecd 100644 --- a/module/plugins/accounts/SimplydebridCom.py +++ b/module/plugins/accounts/SimplydebridCom.py @@ -1,14 +1,14 @@ # -*- coding: utf-8 -*- -from time import mktime, strptime +import time -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class SimplydebridCom(Account): __name__ = "SimplydebridCom" __type__ = "account" - __version__ = "0.11" + __version__ = "0.12" __description__ = """Simply-Debrid.com account plugin""" __license__ = "GPLv3" @@ -22,7 +22,7 @@ class SimplydebridCom(Account): if str(data[0]) != "1": return {"premium": False} else: - return {"trafficleft": -1, "validuntil": mktime(strptime(str(data[2]), "%d/%m/%Y"))} + return {"trafficleft": -1, "validuntil": time.mktime(time.strptime(str(data[2]), "%d/%m/%Y"))} def login(self, user, data, req): @@ -30,6 +30,6 @@ class SimplydebridCom(Account): self.password = data['password'] get_data = {'login': 1, 'u': self.loginname, 'p': self.password} - res = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True) + res = req.load("https://simply-debrid.com/api.php", get=get_data, decode=True) if res != "02: loggin success": self.wrongPassword() diff --git a/module/plugins/accounts/SmoozedCom.py b/module/plugins/accounts/SmoozedCom.py index e6c25752b..b51e5cef3 100644 --- a/module/plugins/accounts/SmoozedCom.py +++ b/module/plugins/accounts/SmoozedCom.py @@ -1,18 +1,32 @@ # -*- coding: utf-8 -*- import hashlib +import time -from beaker.crypto.pbkdf2 import PBKDF2 -from time import time +try: + from beaker.crypto.pbkdf2 import PBKDF2 + +except ImportError: + from beaker.crypto.pbkdf2 import pbkdf2 + from binascii import b2a_hex + + class PBKDF2(object): + def __init__(self, passphrase, salt, iterations=1000): + self.passphrase = passphrase + self.salt = salt + self.iterations = iterations + + def hexread(self, octets): + return b2a_hex(pbkdf2(self.passphrase, self.salt, self.iterations, octets)) from module.common.json_layer import json_loads -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class SmoozedCom(Account): __name__ = "SmoozedCom" __type__ = "account" - __version__ = "0.03" + __version__ = "0.06" __description__ = """Smoozed.com account plugin""" __license__ = "GPLv3" @@ -20,7 +34,6 @@ class SmoozedCom(Account): def loadAccountInfo(self, user, req): - # Get user data from premiumize.me status = self.getAccountStatus(user, req) self.logDebug(status) @@ -36,8 +49,11 @@ class SmoozedCom(Account): 'session' : status["data"]["session_key"], 'hosters' : [hoster["name"] for hoster in status["data"]["hoster"]]} - if info['validuntil'] < time(): - info['premium'] = False + if info['validuntil'] < time.time(): + if float(status["data"]["user"].get("user_trial", 0)) > time.time(): + info['premium'] = True + else: + info['premium'] = False else: info['premium'] = True diff --git a/module/plugins/accounts/StahnuTo.py b/module/plugins/accounts/StahnuTo.py deleted file mode 100644 index 882dbd2c3..000000000 --- a/module/plugins/accounts/StahnuTo.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.Account import Account - - -class StahnuTo(Account): - __name__ = "StahnuTo" - __type__ = "account" - __version__ = "0.05" - - __description__ = """StahnuTo account plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - - - def loadAccountInfo(self, user, req): - html = req.load("http://www.stahnu.to/") - - m = re.search(r'>VIP: (\d+.*)<', html) - trafficleft = self.parseTraffic(m.group(1)) if m else 0 - - return {"premium": trafficleft > 512, "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'], - "submit": "Login"}, - decode=True) - - if not '<a href="logout.php">' in html: - self.wrongPassword() diff --git a/module/plugins/accounts/TurbobitNet.py b/module/plugins/accounts/TurbobitNet.py index a857649eb..43aaf6aa3 100644 --- a/module/plugins/accounts/TurbobitNet.py +++ b/module/plugins/accounts/TurbobitNet.py @@ -1,15 +1,15 @@ # -*- coding: utf-8 -*- import re -from time import mktime, strptime +import time -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class TurbobitNet(Account): __name__ = "TurbobitNet" __type__ = "account" - __version__ = "0.02" + __version__ = "0.03" __description__ = """TurbobitNet account plugin""" __license__ = "GPLv3" @@ -22,7 +22,7 @@ class TurbobitNet(Account): m = re.search(r'<u>Turbo Access</u> to ([\d.]+)', html) if m: premium = True - validuntil = mktime(strptime(m.group(1), "%d.%m.%Y")) + validuntil = time.mktime(time.strptime(m.group(1), "%d.%m.%Y")) else: premium = False validuntil = -1 diff --git a/module/plugins/accounts/TusfilesNet.py b/module/plugins/accounts/TusfilesNet.py index 279dfd00a..18e7b0b57 100644 --- a/module/plugins/accounts/TusfilesNet.py +++ b/module/plugins/accounts/TusfilesNet.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from time import mktime, strptime, gmtime +import time from module.plugins.internal.XFSAccount import XFSAccount @@ -12,7 +11,7 @@ class TusfilesNet(XFSAccount): __type__ = "account" __version__ = "0.06" - __description__ = """ Tusfile.net account plugin """ + __description__ = """Tusfile.net account plugin""" __license__ = "GPLv3" __authors__ = [("guidobelix", "guidobelix@hotmail.it")] diff --git a/module/plugins/accounts/UlozTo.py b/module/plugins/accounts/UlozTo.py index 7236a4fa8..b4f393bfc 100644 --- a/module/plugins/accounts/UlozTo.py +++ b/module/plugins/accounts/UlozTo.py @@ -1,16 +1,15 @@ # -*- coding: utf-8 -*- import re +import urlparse -from urlparse import urljoin - -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class UlozTo(Account): __name__ = "UlozTo" __type__ = "account" - __version__ = "0.10" + __version__ = "0.11" __description__ = """Uloz.to account plugin""" __license__ = "GPLv3" @@ -18,7 +17,7 @@ class UlozTo(Account): ("pulpe", None)] - TRAFFIC_LEFT_PATTERN = r'<li class="menu-kredit"><a .*?title="[^"]*?GB = ([\d.]+) MB"' + TRAFFIC_LEFT_PATTERN = r'<li class="menu-kredit"><a .*?title=".+?GB = ([\d.]+) MB"' def loadAccountInfo(self, user, req): @@ -37,7 +36,7 @@ class UlozTo(Account): action = re.findall('<form action="(.+?)"', login_page)[1].replace('&', '&') token = re.search('_token_" value="(.+?)"', login_page).group(1) - html = req.load(urljoin("http://www.ulozto.net/", action), + html = req.load(urlparse.urljoin("https://www.ulozto.net/", action), post={'_token_' : token, 'do' : "loginForm-submit", 'login' : u"Přihlásit", diff --git a/module/plugins/accounts/UnrestrictLi.py b/module/plugins/accounts/UnrestrictLi.py deleted file mode 100644 index 6a8187234..000000000 --- a/module/plugins/accounts/UnrestrictLi.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.Account import Account -from module.common.json_layer import json_loads - - -class UnrestrictLi(Account): - __name__ = "UnrestrictLi" - __type__ = "account" - __version__ = "0.05" - - __description__ = """Unrestrict.li account plugin""" - __license__ = "GPLv3" - __authors__ = [("stickell", "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) - json_data = json_loads(json_data) - - if 'vip' in json_data['result'] and json_data['result']['vip'] == 0: - return {"premium": False} - - validuntil = json_data['result']['expires'] - trafficleft = float(json_data['result']['traffic'] / 1024) #@TODO: Remove `/ 1024` in 0.4.10 - - return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft} - - - def login(self, user, data, req): - req.cj.setCookie("unrestrict.li", "lang", "EN") - html = req.load("https://unrestrict.li/sign_in", decode=True) - - if 'solvemedia' in html: - 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'], - "remember_me": "remember", "signin": "Sign in"} - html = req.load("https://unrestrict.li/sign_in", post=post_data, decode=True) - - if 'sign_out' not in html: - self.wrongPassword() diff --git a/module/plugins/accounts/UploadableCh.py b/module/plugins/accounts/UploadableCh.py index 86ae5dd17..9543feb6d 100644 --- a/module/plugins/accounts/UploadableCh.py +++ b/module/plugins/accounts/UploadableCh.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class UploadableCh(Account): __name__ = "UploadableCh" __type__ = "account" - __version__ = "0.03" + __version__ = "0.04" __description__ = """Uploadable.ch account plugin""" __license__ = "GPLv3" diff --git a/module/plugins/accounts/UploadedTo.py b/module/plugins/accounts/UploadedTo.py index 1b6df97fb..dc4c9fb73 100644 --- a/module/plugins/accounts/UploadedTo.py +++ b/module/plugins/accounts/UploadedTo.py @@ -1,15 +1,15 @@ # -*- coding: utf-8 -*- import re -from time import time +import time -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class UploadedTo(Account): __name__ = "UploadedTo" __type__ = "account" - __version__ = "0.30" + __version__ = "0.31" __description__ = """Uploaded.to account plugin""" __license__ = "GPLv3" @@ -39,7 +39,7 @@ class UploadedTo(Account): else: m = re.findall(r'(\d+) (week|day|hour)', expiredate) if m: - validuntil = time() + validuntil = time.time() for n, u in m: validuntil += float(n) * 60 * 60 * {'week': 168, 'day': 24, 'hour': 1}[u] @@ -55,13 +55,15 @@ class UploadedTo(Account): else: trafficleft = self.parseTraffic(size + unit) - return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} + return {'validuntil' : validuntil, + 'trafficleft': trafficleft, + 'premium' : premium} def login(self, user, data, req): # req.cj.setCookie("uploaded.net", "lang", "en") - html = req.load("http://uploaded.net/io/login", + html = req.load("https://uploaded.net/io/login", post={'id': user, 'pw': data['password'], '_': ""}, decode=True) diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py index 714f5b0a6..f8f2fbc1d 100644 --- a/module/plugins/accounts/UploadheroCom.py +++ b/module/plugins/accounts/UploadheroCom.py @@ -4,13 +4,13 @@ import re import datetime import time -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class UploadheroCom(Account): __name__ = "UploadheroCom" __type__ = "account" - __version__ = "0.21" + __version__ = "0.22" __description__ = """Uploadhero.co account plugin""" __license__ = "GPLv3" diff --git a/module/plugins/accounts/UploadingCom.py b/module/plugins/accounts/UploadingCom.py index c70d2ec11..967f79678 100644 --- a/module/plugins/accounts/UploadingCom.py +++ b/module/plugins/accounts/UploadingCom.py @@ -1,17 +1,16 @@ # -*- coding: utf-8 -*- import re +import time -from time import time, strptime, mktime - -from module.plugins.Account import Account +from module.plugins.internal.Account import Account from module.plugins.internal.SimpleHoster import set_cookies class UploadingCom(Account): __name__ = "UploadingCom" __type__ = "account" - __version__ = "0.11" + __version__ = "0.13" __description__ = """Uploading.com account plugin""" __license__ = "GPLv3" @@ -37,27 +36,30 @@ class UploadingCom(Account): self.logDebug("Expire date: " + expiredate) try: - validuntil = mktime(strptime(expiredate, "%b %d, %Y")) + validuntil = time.mktime(time.strptime(expiredate, "%b %d, %Y")) except Exception, e: self.logError(e) else: - if validuntil > mktime(gmtime()): - premium = True + if validuntil > time.mktime(time.gmtime()): + premium = True else: - premium = False + premium = False validuntil = None - return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} + return {'validuntil' : validuntil, + 'trafficleft': trafficleft, + 'premium' : premium} def login(self, user, data, req): - set_cookies([("uploading.com", "lang", "1"), - ("uploading.com", "language", "1"), - ("uploading.com", "setlang", "en"), - ("uploading.com", "_lang", "en")] + set_cookies(req.cj, + [("uploading.com", "lang" , "1" ), + ("uploading.com", "language", "1" ), + ("uploading.com", "setlang" , "en"), + ("uploading.com", "_lang" , "en")]) req.load("http://uploading.com/") - req.load("http://uploading.com/general/login_form/?JsHttpRequest=%s-xml" % long(time() * 1000), + req.load("https://uploading.com/general/login_form/?JsHttpRequest=%s-xml" % long(time.time() * 1000), post={'email': user, 'password': data['password'], 'remember': "on"}) diff --git a/module/plugins/accounts/UptoboxCom.py b/module/plugins/accounts/UptoboxCom.py index 299a0acc2..c40dbd6e6 100644 --- a/module/plugins/accounts/UptoboxCom.py +++ b/module/plugins/accounts/UptoboxCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount class UptoboxCom(XFSAccount): __name__ = "UptoboxCom" __type__ = "account" - __version__ = "0.07" + __version__ = "0.08" __description__ = """DDLStorage.com account plugin""" __license__ = "GPLv3" @@ -15,3 +15,4 @@ class UptoboxCom(XFSAccount): HOSTER_DOMAIN = "uptobox.com" HOSTER_URL = "https://uptobox.com/" + LOGIN_URL = "https://login.uptobox.com/" diff --git a/module/plugins/accounts/WebshareCz.py b/module/plugins/accounts/WebshareCz.py index f8e3eeb73..c88e86aba 100644 --- a/module/plugins/accounts/WebshareCz.py +++ b/module/plugins/accounts/WebshareCz.py @@ -1,18 +1,18 @@ # -*- coding: utf-8 -*- +import hashlib import re +import time -from hashlib import md5, sha1 from passlib.hash import md5_crypt -from time import mktime, strptime, time -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class WebshareCz(Account): __name__ = "WebshareCz" __type__ = "account" - __version__ = "0.07" + __version__ = "0.09" __description__ = """Webshare.cz account plugin""" __license__ = "GPLv3" @@ -26,7 +26,7 @@ class WebshareCz(Account): def loadAccountInfo(self, user, req): html = req.load("https://webshare.cz/api/user_data/", - post={'wst': self.infos['wst']}, + post={'wst': self.getAccountData(user).get('wst', None)}, decode=True) self.logDebug("Response: " + html) @@ -34,9 +34,9 @@ class WebshareCz(Account): expiredate = re.search(self.VALID_UNTIL_PATTERN, html).group(1) self.logDebug("Expire date: " + expiredate) - validuntil = mktime(strptime(expiredate, "%Y-%m-%d %H:%M:%S")) + validuntil = time.mktime(time.strptime(expiredate, "%Y-%m-%d %H:%M:%S")) trafficleft = self.parseTraffic(re.search(self.TRAFFIC_LEFT_PATTERN, html).group(1)) - premium = validuntil > time() + premium = validuntil > time.time() return {'validuntil': validuntil, 'trafficleft': -1, 'premium': premium} @@ -51,8 +51,8 @@ class WebshareCz(Account): self.wrongPassword() salt = re.search('<salt>(.+)</salt>', salt).group(1) - password = sha1(md5_crypt.encrypt(data["password"], salt=salt)).hexdigest() - digest = md5(user + ":Webshare:" + password).hexdigest() + password = hashlib.sha1(md5_crypt.encrypt(data["password"], salt=salt)).hexdigest() + digest = hashlib.md5(user + ":Webshare:" + password).hexdigest() login = req.load("https://webshare.cz/api/login/", post={'digest' : digest, @@ -65,4 +65,4 @@ class WebshareCz(Account): if "<status>OK</status>" not in login: self.wrongPassword() - self.infos['wst'] = re.search('<token>(.+)</token>', login).group(1) + data['wst'] = re.search('<token>(.+)</token>', login).group(1) diff --git a/module/plugins/accounts/WorldbytezCom.py b/module/plugins/accounts/WorldbytezCom.py new file mode 100644 index 000000000..a90dbea56 --- /dev/null +++ b/module/plugins/accounts/WorldbytezCom.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.XFSAccount import XFSAccount + + +class WorldbytezCom(XFSAccount): + __name__ = "WorldbytezCom" + __type__ = "account" + __version__ = "0.01" + + __description__ = """Worldbytez.com account plugin""" + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + + HOSTER_DOMAIN = "worldbytez.com" diff --git a/module/plugins/accounts/YibaishiwuCom.py b/module/plugins/accounts/YibaishiwuCom.py index 863588495..2f1c990ec 100644 --- a/module/plugins/accounts/YibaishiwuCom.py +++ b/module/plugins/accounts/YibaishiwuCom.py @@ -2,13 +2,13 @@ import re -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class YibaishiwuCom(Account): __name__ = "YibaishiwuCom" __type__ = "account" - __version__ = "0.02" + __version__ = "0.03" __description__ = """115.com account plugin""" __license__ = "GPLv3" @@ -23,13 +23,13 @@ class YibaishiwuCom(Account): html = req.load("http://115.com/", decode=True) m = re.search(self.ACCOUNT_INFO_PATTERN, html, re.S) - premium = True if (m and 'is_vip: 1' in m.group(1)) else False + 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): - html = req.load("http://passport.115.com/?ac=login", + html = req.load("https://passport.115.com/?ac=login", post={"back": "http://www.115.com/", "goto": "http://115.com/", "login[account]": user, diff --git a/module/plugins/accounts/ZeveraCom.py b/module/plugins/accounts/ZeveraCom.py index 6c69a974f..220a6600e 100644 --- a/module/plugins/accounts/ZeveraCom.py +++ b/module/plugins/accounts/ZeveraCom.py @@ -1,14 +1,14 @@ # -*- coding: utf-8 -*- -from time import mktime, strptime +import time -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class ZeveraCom(Account): __name__ = "ZeveraCom" __type__ = "account" - __version__ = "0.24" + __version__ = "0.27" __description__ = """Zevera.com account plugin""" __license__ = "GPLv3" @@ -39,8 +39,8 @@ class ZeveraCom(Account): api = self.api_response(req) - if api != "No trafic": - validuntil = mktime(strptime(api['endsubscriptiondate'], "%Y/%m/%d %H:%M:%S")) + if "No trafic" not in api and api['endsubscriptiondate'] != "Expired!": + validuntil = time.mktime(time.strptime(api['endsubscriptiondate'], "%Y/%m/%d %H:%M:%S")) trafficleft = float(api['availabletodaytraffic']) * 1024 if api['orondaytrafficlimit'] != '0' else -1 premium = True |