diff options
Diffstat (limited to 'module/plugins/accounts/AlldebridCom.py')
-rw-r--r-- | module/plugins/accounts/AlldebridCom.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index 1f2371e28..d09086907 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -1,9 +1,8 @@ # -*- 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 @@ -33,19 +32,19 @@ 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", 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 |