From 8342aad089589479650703de915a356d634b202b Mon Sep 17 00:00:00 2001 From: Stefano Date: Sat, 23 Mar 2013 22:32:28 +0100 Subject: Plugins: fixed inconsistent indentation --- module/plugins/accounts/AlldebridCom.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index 7d4d245ba..beaddeac9 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -17,20 +17,20 @@ class AlldebridCom(Account): data = self.getAccountData(user) page = req.load("http://www.alldebrid.com/account/") soup=BeautifulSoup(page) - #Try to parse expiration date directly from the control panel page (better accuracy) + #Try to parse expiration date directly from the control panel page (better accuracy) try: - time_text=soup.find('div',attrs={'class':'remaining_time_text'}).strong.string - self.log.debug("Account expires in: %s" % time_text) - p = re.compile('\d+') - exp_data=p.findall(time_text) - exp_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 + time_text=soup.find('div',attrs={'class':'remaining_time_text'}).strong.string + self.log.debug("Account expires in: %s" % time_text) + p = re.compile('\d+') + exp_data=p.findall(time_text) + exp_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: - data = self.getAccountData(user) - page = req.load("http://www.alldebrid.com/api.php?action=info_user&login=%s&pw=%s" % (user, data["password"])) - self.log.debug(page) - xml = dom.parseString(page) - exp_time=time()+int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue)*86400 + data = self.getAccountData(user) + page = req.load("http://www.alldebrid.com/api.php?action=info_user&login=%s&pw=%s" % (user, data["password"])) + self.log.debug(page) + xml = dom.parseString(page) + exp_time=time()+int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue)*86400 account_info = {"validuntil": exp_time, "trafficleft": -1} return account_info @@ -40,7 +40,7 @@ class AlldebridCom(Account): page = req.load("http://www.alldebrid.com/register/?%s" % (urlparams)) if "This login doesn't exist" in page: - self.wrongPassword() + self.wrongPassword() if "The password is not valid" in page: self.wrongPassword() -- cgit v1.2.3