diff options
author | lazlev <lazlev@yopmail.com> | 2015-08-09 00:50:54 +0200 |
---|---|---|
committer | lazlev <lazlev@yopmail.com> | 2015-08-09 00:50:54 +0200 |
commit | b0ef3f1673e1930916604bb1264ca3a38414bc8d (patch) | |
tree | c97936e4d2a4cd6eb1072c65c8a08a7d18816b18 /module/plugins/accounts/OneFichierCom.py | |
parent | [XFileSharingPro][XFileSharingProFolder] Added default __pattern__ (diff) | |
parent | Fix https://github.com/pyload/pyload/issues/1707 (diff) | |
download | pyload-b0ef3f1673e1930916604bb1264ca3a38414bc8d.tar.xz |
Merge pull request #1 from pyload/stable
sync with stable
Diffstat (limited to 'module/plugins/accounts/OneFichierCom.py')
-rw-r--r-- | module/plugins/accounts/OneFichierCom.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py index b19e2bc69..3a0131a3f 100644 --- a/module/plugins/accounts/OneFichierCom.py +++ b/module/plugins/accounts/OneFichierCom.py @@ -4,13 +4,14 @@ import pycurl import re import time -from module.plugins.Account import Account +from module.plugins.internal.Account import Account class OneFichierCom(Account): __name__ = "OneFichierCom" __type__ = "account" - __version__ = "0.12" + __version__ = "0.14" + __status__ = "testing" __description__ = """1fichier.com account plugin""" __license__ = "GPLv3" @@ -21,38 +22,37 @@ class OneFichierCom(Account): VALID_UNTIL_PATTERN = r'Your Premium Status will end the (\d+/\d+/\d+)' - def loadAccountInfo(self, user, req): + def parse_info(self, user, password, data, req): validuntil = None trafficleft = -1 premium = None - html = req.load("https://1fichier.com/console/abo.pl") + html = self.load("https://1fichier.com/console/abo.pl") m = re.search(self.VALID_UNTIL_PATTERN, html) if m: expiredate = m.group(1) - self.logDebug("Expire date: " + expiredate) + self.log_debug("Expire date: " + expiredate) try: validuntil = time.mktime(time.strptime(expiredate, "%d/%m/%Y")) except Exception, e: - self.logError(e) + self.log_error(e) else: premium = True return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium or False} - def login(self, user, data, req): + def login(self, user, password, data, req): req.http.c.setopt(pycurl.REFERER, "https://1fichier.com/login.pl?lg=en") - html = req.load("https://1fichier.com/login.pl?lg=en", - post={'mail' : user, - 'pass' : data['password'], - 'It' : "on", - 'purge' : "off", - 'valider': "Send"}, - decode=True) + html = self.load("https://1fichier.com/login.pl?lg=en", + post={'mail' : user, + 'pass' : password, + 'It' : "on", + 'purge' : "off", + 'valider': "Send"}) if '>Invalid email address' in html or '>Invalid password' in html: - self.wrongPassword() + self.login_fail() |