summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/OneFichierCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/accounts/OneFichierCom.py')
-rw-r--r--module/plugins/accounts/OneFichierCom.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py
index 3a0131a3f..0249f2b93 100644
--- a/module/plugins/accounts/OneFichierCom.py
+++ b/module/plugins/accounts/OneFichierCom.py
@@ -10,7 +10,7 @@ from module.plugins.internal.Account import Account
class OneFichierCom(Account):
__name__ = "OneFichierCom"
__type__ = "account"
- __version__ = "0.14"
+ __version__ = "0.17"
__status__ = "testing"
__description__ = """1fichier.com account plugin"""
@@ -19,10 +19,10 @@ class OneFichierCom(Account):
("Walter Purcaro", "vuolter@gmail.com")]
- VALID_UNTIL_PATTERN = r'Your Premium Status will end the (\d+/\d+/\d+)'
+ VALID_UNTIL_PATTERN = r'Your subscription will end the (\d+-\d+-\d+)'
- def parse_info(self, user, password, data, req):
+ def grab_info(self, user, password, data):
validuntil = None
trafficleft = -1
premium = None
@@ -30,12 +30,13 @@ class OneFichierCom(Account):
html = self.load("https://1fichier.com/console/abo.pl")
m = re.search(self.VALID_UNTIL_PATTERN, html)
- if m:
+ if m is not None:
expiredate = m.group(1)
self.log_debug("Expire date: " + expiredate)
try:
- validuntil = time.mktime(time.strptime(expiredate, "%d/%m/%Y"))
+ validuntil = time.mktime(time.strptime(expiredate, "%Y-%m-%d"))
+
except Exception, e:
self.log_error(e)
else:
@@ -44,8 +45,8 @@ class OneFichierCom(Account):
return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium or False}
- def login(self, user, password, data, req):
- req.http.c.setopt(pycurl.REFERER, "https://1fichier.com/login.pl?lg=en")
+ def signin(self, user, password, data):
+ self.req.http.c.setopt(pycurl.REFERER, "https://1fichier.com/login.pl?lg=en")
html = self.load("https://1fichier.com/login.pl?lg=en",
post={'mail' : user,
@@ -55,4 +56,4 @@ class OneFichierCom(Account):
'valider': "Send"})
if '>Invalid email address' in html or '>Invalid password' in html:
- self.login_fail()
+ self.fail_login()