From a1b105f5e74df07abeab46a29de16416954fe4b8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 2 Jun 2015 03:42:55 +0200 Subject: Small code cosmetics --- module/plugins/accounts/AlldebridCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/AlldebridCom.py') diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index f9c1f2ca6..d09086907 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -2,7 +2,7 @@ import re import time -import xml.dom.minidom as dom +import xml.dom.minidom from BeautifulSoup import BeautifulSoup @@ -43,7 +43,7 @@ class AlldebridCom(Account): self.logDebug(html) - xml = dom.parseString(html) + 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} -- cgit v1.2.3 From 049298dbdbff33918454b03a3b072f418d47af97 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 6 Jun 2015 05:33:38 +0200 Subject: Use SSL when login account --- module/plugins/accounts/AlldebridCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/AlldebridCom.py') diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index d09086907..2d42b9c5c 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -38,7 +38,7 @@ class AlldebridCom(Account): #Get expiration date from API 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) @@ -51,7 +51,7 @@ class AlldebridCom(Account): 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']}, -- cgit v1.2.3 From 0e1ef9bc01579328e17e79416fa3c1c7b77adcc8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Jun 2015 06:08:01 +0200 Subject: Update everything --- module/plugins/accounts/AlldebridCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/AlldebridCom.py') diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index 2d42b9c5c..e9084dcc3 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -6,13 +6,13 @@ 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" -- cgit v1.2.3 From ee9bb026433c4cd79b84efb06ca195447c4d7916 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 15 Jun 2015 18:18:30 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1501 --- module/plugins/accounts/AlldebridCom.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'module/plugins/accounts/AlldebridCom.py') diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index e9084dcc3..e02983e1c 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -12,7 +12,7 @@ from module.plugins.internal.Account import Account class AlldebridCom(Account): __name__ = "AlldebridCom" __type__ = "account" - __version__ = "0.24" + __version__ = "0.25" __description__ = """AllDebrid.com account plugin""" __license__ = "GPLv3" @@ -46,8 +46,9 @@ class AlldebridCom(Account): 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 + return {'validuntil' : exp_time, + 'trafficleft': -1 , + 'premium' : True } def login(self, user, data, req): -- cgit v1.2.3 From c1764e2fea0bb05164c83a876e8cd58b97f58f25 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 16 Jun 2015 17:31:38 +0200 Subject: Update all --- module/plugins/accounts/AlldebridCom.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'module/plugins/accounts/AlldebridCom.py') diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index e02983e1c..a109faf4f 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -2,7 +2,7 @@ import re import time -import xml.dom.minidom +import xml.dom.minidom as dom from BeautifulSoup import BeautifulSoup @@ -21,7 +21,7 @@ class AlldebridCom(Account): def loadAccountInfo(self, user, req): data = self.getAccountData(user) - html = req.load("http://www.alldebrid.com/account/") + html = self.load("http://www.alldebrid.com/account/", req=req) soup = BeautifulSoup(html) #Try to parse expiration date directly from the control panel page (better accuracy) @@ -38,12 +38,12 @@ class AlldebridCom(Account): #Get expiration date from API except Exception: data = self.getAccountData(user) - html = req.load("https://www.alldebrid.com/api.php", - get={'action': "info_user", 'login': user, 'pw': data['password']}) + html = self.load("https://www.alldebrid.com/api.php", + get={'action': "info_user", 'login': user, 'pw': data['password']}, req=req) self.logDebug(html) - xml = xml.dom.minidom.parseString(html) + xml = dom.parseString(html) exp_time = time.time() + int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue) * 24 * 60 * 60 return {'validuntil' : exp_time, @@ -52,11 +52,10 @@ class AlldebridCom(Account): def login(self, user, data, req): - html = req.load("https://www.alldebrid.com/register/", + html = self.load("https://www.alldebrid.com/register/", get={'action' : "login", 'login_login' : user, - 'login_password': data['password']}, - decode=True) + 'login_password': data['password']}, req=req) if "This login doesn't exist" in html \ or "The password is not valid" in html \ -- cgit v1.2.3 From b1759bc440cd6013837697eb8de540914f693ffd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Jul 2015 01:23:55 +0200 Subject: No camelCase style anymore --- module/plugins/accounts/AlldebridCom.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'module/plugins/accounts/AlldebridCom.py') diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index a109faf4f..eb58da928 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -12,36 +12,36 @@ from module.plugins.internal.Account import Account class AlldebridCom(Account): __name__ = "AlldebridCom" __type__ = "account" - __version__ = "0.25" + __version__ = "0.26" __description__ = """AllDebrid.com account plugin""" __license__ = "GPLv3" __authors__ = [("Andy Voigt", "spamsales@online.de")] - def loadAccountInfo(self, user, req): - data = self.getAccountData(user) + def load_account_info(self, user, req): + data = self.get_account_data(user) html = self.load("http://www.alldebrid.com/account/", req=req) soup = BeautifulSoup(html) - #Try to parse expiration date directly from the control panel page (better accuracy) + # Try to parse expiration date directly from the control panel page (better accuracy) try: time_text = soup.find('div', attrs={'class': 'remaining_time_text'}).strong.string - self.logDebug("Account expires in: %s" % time_text) + self.log_debug("Account expires in: %s" % time_text) p = re.compile('\d+') exp_data = p.findall(time_text) 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 + # Get expiration date from API except Exception: - data = self.getAccountData(user) + data = self.get_account_data(user) html = self.load("https://www.alldebrid.com/api.php", get={'action': "info_user", 'login': user, 'pw': data['password']}, req=req) - self.logDebug(html) + self.log_debug(html) xml = dom.parseString(html) exp_time = time.time() + int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue) * 24 * 60 * 60 @@ -60,4 +60,4 @@ class AlldebridCom(Account): if "This login doesn't exist" in html \ or "The password is not valid" in html \ or "Invalid captcha" in html: - self.wrongPassword() + self.wrong_password() -- cgit v1.2.3 From d2e2b127651a5a44b56337eb6d9ca246c97a208a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 17 Jul 2015 03:03:26 +0200 Subject: Spare fixes and code cosmetics --- module/plugins/accounts/AlldebridCom.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/AlldebridCom.py') diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index eb58da928..f73c3e0fd 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -39,7 +39,10 @@ class AlldebridCom(Account): except Exception: data = self.get_account_data(user) html = self.load("https://www.alldebrid.com/api.php", - get={'action': "info_user", 'login': user, 'pw': data['password']}, req=req) + get={'action': "info_user", + 'login' : user, + 'pw' : data['password']}, + req=req) self.log_debug(html) @@ -53,9 +56,10 @@ class AlldebridCom(Account): def login(self, user, data, req): html = self.load("https://www.alldebrid.com/register/", - get={'action' : "login", - 'login_login' : user, - 'login_password': data['password']}, req=req) + get={'action' : "login", + 'login_login' : user, + 'login_password': data['password']}, + req=req) if "This login doesn't exist" in html \ or "The password is not valid" in html \ -- cgit v1.2.3 From 1f5a55ae2133a782bdcca334ecbcdbde50dbcf99 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 17 Jul 2015 15:29:48 +0200 Subject: No more need to use the req argument when call load method --- module/plugins/accounts/AlldebridCom.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'module/plugins/accounts/AlldebridCom.py') diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index f73c3e0fd..903499d5b 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -21,7 +21,7 @@ class AlldebridCom(Account): def load_account_info(self, user, req): data = self.get_account_data(user) - html = self.load("http://www.alldebrid.com/account/", req=req) + html = self.load("http://www.alldebrid.com/account/") soup = BeautifulSoup(html) # Try to parse expiration date directly from the control panel page (better accuracy) @@ -41,8 +41,7 @@ class AlldebridCom(Account): html = self.load("https://www.alldebrid.com/api.php", get={'action': "info_user", 'login' : user, - 'pw' : data['password']}, - req=req) + 'pw' : data['password']}) self.log_debug(html) @@ -58,8 +57,7 @@ class AlldebridCom(Account): html = self.load("https://www.alldebrid.com/register/", get={'action' : "login", 'login_login' : user, - 'login_password': data['password']}, - req=req) + 'login_password': data['password']}) if "This login doesn't exist" in html \ or "The password is not valid" in html \ -- cgit v1.2.3 From 9e5d813d7721e351ac02ba72bdc473a7d77ba6b7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 18 Jul 2015 20:04:36 +0200 Subject: Code cosmetics --- module/plugins/accounts/AlldebridCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/AlldebridCom.py') diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index 903499d5b..cfa7840bc 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -4,7 +4,7 @@ import re import time import xml.dom.minidom as dom -from BeautifulSoup import BeautifulSoup +import BeautifulSoup from module.plugins.internal.Account import Account @@ -22,7 +22,7 @@ class AlldebridCom(Account): def load_account_info(self, user, req): data = self.get_account_data(user) html = self.load("http://www.alldebrid.com/account/") - soup = BeautifulSoup(html) + soup = BeautifulSoup.BeautifulSoup(html) # Try to parse expiration date directly from the control panel page (better accuracy) try: -- cgit v1.2.3 From dad722ac7255640e7e0541c4094a4d2e4de79cd3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 00:05:58 +0200 Subject: Code cosmetics (2) --- module/plugins/accounts/AlldebridCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/AlldebridCom.py') diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index cfa7840bc..9c27c18d0 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -24,7 +24,7 @@ class AlldebridCom(Account): html = self.load("http://www.alldebrid.com/account/") soup = BeautifulSoup.BeautifulSoup(html) - # Try to parse expiration date directly from the control panel page (better accuracy) + #: Try to parse expiration date directly from the control panel page (better accuracy) try: time_text = soup.find('div', attrs={'class': 'remaining_time_text'}).strong.string @@ -35,7 +35,7 @@ class AlldebridCom(Account): 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 + #: Get expiration date from API except Exception: data = self.get_account_data(user) html = self.load("https://www.alldebrid.com/api.php", -- cgit v1.2.3 From d38e830b7c0b3c6561a0072c74bbccb5fcdf4a61 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 14:43:42 +0200 Subject: New __status__ magic key --- module/plugins/accounts/AlldebridCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/AlldebridCom.py') diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index 9c27c18d0..45ca034de 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -13,6 +13,7 @@ class AlldebridCom(Account): __name__ = "AlldebridCom" __type__ = "account" __version__ = "0.26" + __status__ = "stable" __description__ = """AllDebrid.com account plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 94d017cd2a5c1f194960827a8c7e46afc3682008 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 06:55:49 +0200 Subject: Hotfixes (2) --- module/plugins/accounts/AlldebridCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/AlldebridCom.py') diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index 45ca034de..290343bc1 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -13,7 +13,7 @@ class AlldebridCom(Account): __name__ = "AlldebridCom" __type__ = "account" __version__ = "0.26" - __status__ = "stable" + __status__ = "testing" __description__ = """AllDebrid.com account plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 8f17f875f6e28f73ddb10da59c6464bd04922222 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Jul 2015 04:59:27 +0200 Subject: Account rewritten --- module/plugins/accounts/AlldebridCom.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'module/plugins/accounts/AlldebridCom.py') diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index 290343bc1..0647892b0 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -20,8 +20,8 @@ class AlldebridCom(Account): __authors__ = [("Andy Voigt", "spamsales@online.de")] - def load_account_info(self, user, req): - data = self.get_account_data(user) + def parse_info(self, user, password, data, req): + data = self.get_data(user) html = self.load("http://www.alldebrid.com/account/") soup = BeautifulSoup.BeautifulSoup(html) @@ -38,11 +38,11 @@ class AlldebridCom(Account): #: Get expiration date from API except Exception: - data = self.get_account_data(user) + data = self.get_data(user) html = self.load("https://www.alldebrid.com/api.php", get={'action': "info_user", 'login' : user, - 'pw' : data['password']}) + 'pw' : password}) self.log_debug(html) @@ -54,13 +54,13 @@ class AlldebridCom(Account): 'premium' : True } - def login(self, user, data, req): + def login(self, user, password, data, req): html = self.load("https://www.alldebrid.com/register/", get={'action' : "login", 'login_login' : user, - 'login_password': data['password']}) + 'login_password': password}) if "This login doesn't exist" in html \ or "The password is not valid" in html \ or "Invalid captcha" in html: - self.wrong_password() + self.fail() -- cgit v1.2.3 From a95c217627a1cb651b24e69f20640df40797aff9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Jul 2015 09:34:18 +0200 Subject: Account rewritten (2) --- module/plugins/accounts/AlldebridCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/AlldebridCom.py') diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index 0647892b0..6a2f09c9c 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -63,4 +63,4 @@ class AlldebridCom(Account): if "This login doesn't exist" in html \ or "The password is not valid" in html \ or "Invalid captcha" in html: - self.fail() + self.login_fail() -- cgit v1.2.3