From 37d898f681e41fe9c9a8719a540eda59bfedd448 Mon Sep 17 00:00:00 2001 From: Stefano Date: Sun, 21 Jul 2013 12:58:42 +0200 Subject: Normalize line endings to avoid line endings merge conflicts --- module/plugins/accounts/UploadheroCom.py | 68 ++++++++++++++++---------------- 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'module/plugins/accounts/UploadheroCom.py') diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py index f1e0649e6..18ed69ae6 100644 --- a/module/plugins/accounts/UploadheroCom.py +++ b/module/plugins/accounts/UploadheroCom.py @@ -1,35 +1,35 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from module.plugins.Account import Account -import re,datetime,time - -class UploadheroCom(Account): - __name__ = "UploadheroCom" - __version__ = "0.1" - __type__ = "account" - __description__ = """Uploadhero.com account plugin""" - __author_name__ = ("mcmyst") - __author_mail__ = ("mcmyst@hotmail.fr") - - - def loadAccountInfo(self, user, req): - premium_pattern = re.compile('Il vous reste ([0-9]+) jours premium.') - - data = self.getAccountData(user) - page = req.load("http://uploadhero.com/my-account") - - if premium_pattern.search(page): - end_date = datetime.date.today() + datetime.timedelta(days=int(premium_pattern.search(page).group(1))) - end_date = time.mktime(future.timetuple()) - account_info = {"validuntil": end_date, "trafficleft": -1, "premium": True} - else: - account_info = {"validuntil": -1, "trafficleft": -1, "premium": False} - - return account_info - - def login(self, user, data, req): - page = req.load("http://uploadhero.com/lib/connexion.php", post={"pseudo_login": user, "password_login": data["password"]}) - - if "mot de passe invalide" in page: +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from module.plugins.Account import Account +import re,datetime,time + +class UploadheroCom(Account): + __name__ = "UploadheroCom" + __version__ = "0.1" + __type__ = "account" + __description__ = """Uploadhero.com account plugin""" + __author_name__ = ("mcmyst") + __author_mail__ = ("mcmyst@hotmail.fr") + + + def loadAccountInfo(self, user, req): + premium_pattern = re.compile('Il vous reste ([0-9]+) jours premium.') + + data = self.getAccountData(user) + page = req.load("http://uploadhero.com/my-account") + + if premium_pattern.search(page): + end_date = datetime.date.today() + datetime.timedelta(days=int(premium_pattern.search(page).group(1))) + end_date = time.mktime(future.timetuple()) + account_info = {"validuntil": end_date, "trafficleft": -1, "premium": True} + else: + account_info = {"validuntil": -1, "trafficleft": -1, "premium": False} + + return account_info + + def login(self, user, data, req): + page = req.load("http://uploadhero.com/lib/connexion.php", post={"pseudo_login": user, "password_login": data["password"]}) + + if "mot de passe invalide" in page: self.wrongPassword() \ No newline at end of file -- cgit v1.2.3