summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/account/DebridItaliaCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugins/account/DebridItaliaCom.py')
-rw-r--r--pyload/plugins/account/DebridItaliaCom.py30
1 files changed, 17 insertions, 13 deletions
diff --git a/pyload/plugins/account/DebridItaliaCom.py b/pyload/plugins/account/DebridItaliaCom.py
index 30ed9fb1c..41f796327 100644
--- a/pyload/plugins/account/DebridItaliaCom.py
+++ b/pyload/plugins/account/DebridItaliaCom.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
import re
-import time
+
+from time import mktime, strptime
from pyload.plugins.internal.Account import Account
@@ -9,32 +10,35 @@ from pyload.plugins.internal.Account import Account
class DebridItaliaCom(Account):
__name__ = "DebridItaliaCom"
__type__ = "account"
- __version__ = "0.1"
+ __version__ = "0.11"
__description__ = """Debriditalia.com account plugin"""
__license__ = "GPLv3"
- __authors__ = [("stickell", "l.stickell@yahoo.it")]
+ __authors__ = [("stickell", "l.stickell@yahoo.it"),
+ ("Walter Purcaro", "vuolter@gmail.com")]
- WALID_UNTIL_PATTERN = r'Premium valid till: (?P<D>[^|]+) \|'
+ WALID_UNTIL_PATTERN = r'Premium valid till: (.+?) \|'
def loadAccountInfo(self, user, req):
+ info = {"premium": False, "validuntil": None, "trafficleft": None}
html = req.load("http://debriditalia.com/")
- if 'Account premium not activated' in html:
- return {"premium": False, "validuntil": None, "trafficleft": None}
+ if 'Account premium not activated' not in html:
+ m = re.search(self.WALID_UNTIL_PATTERN, html)
+ if m:
+ validuntil = int(mktime(strptime(m.group(1), "%d/%m/%Y %H:%M")))
+ info = {"premium": True, "validuntil": validuntil, "trafficleft": -1}
+ else:
+ self.logError(_("Unable to retrieve account information"))
- 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"))
+ return info
def login(self, user, data, req):
html = req.load("http://debriditalia.com/login.php",
- get={"u": user, "p": data['password']})
+ get={'u': user, 'p': data['password']})
+
if 'NO' in html:
self.wrongPassword()