From 6a0fb7fdd4ea2749be44625225d8a235a78f032f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:42:39 +0200 Subject: [accounts] Code cosmetics --- module/plugins/accounts/DebridItaliaCom.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'module/plugins/accounts/DebridItaliaCom.py') diff --git a/module/plugins/accounts/DebridItaliaCom.py b/module/plugins/accounts/DebridItaliaCom.py index 754d3467d..48b46cc0b 100644 --- a/module/plugins/accounts/DebridItaliaCom.py +++ b/module/plugins/accounts/DebridItaliaCom.py @@ -20,18 +20,21 @@ class DebridItaliaCom(Account): def loadAccountInfo(self, user, req): - if 'Account premium not activated' in self.html: + html = req.load("http://debriditalia.com/") + + if 'Account premium not activated' in html: return {"premium": False, "validuntil": None, "trafficleft": None} - m = re.search(self.WALID_UNTIL_PATTERN, self.html) + m = re.search(self.WALID_UNTIL_PATTERN, html) if m: validuntil = int(time.mktime(time.strptime(m.group('D'), "%d/%m/%Y %H:%M"))) return {"premium": True, "validuntil": validuntil, "trafficleft": -1} else: self.logError("Unable to retrieve account information - Plugin may be out of date") + def login(self, user, data, req): - self.html = req.load("http://debriditalia.com/login.php", - get={"u": user, "p": data['password']}) - if 'NO' in self.html: + html = req.load("http://debriditalia.com/login.php", + get={"u": user, "p": data['password']}) + if 'NO' in html: self.wrongPassword() -- cgit v1.2.3