From a40cf88920e94490d5c851fb273b8d2f48aef6fb Mon Sep 17 00:00:00 2001 From: mkaay Date: Fri, 10 Jun 2011 13:09:33 +0200 Subject: ernieb's hoster patches --- module/plugins/accounts/X7To.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/X7To.py') diff --git a/module/plugins/accounts/X7To.py b/module/plugins/accounts/X7To.py index 1e3ef782e..abfb13e5e 100644 --- a/module/plugins/accounts/X7To.py +++ b/module/plugins/accounts/X7To.py @@ -36,10 +36,9 @@ class X7To(Account): valid = re.search("Premium-Mitglied bis ([0-9]*-[0-9]*-[0-9]*)", page, re.IGNORECASE).group(1) valid = int(mktime(strptime(valid, "%Y-%m-%d"))) - trafficleft = re.search('([\d]*)[,]?[\d]?[\d]? (KB|MB|GB)', page, - re.IGNORECASE) + trafficleft = re.search(r'([\d]*[,]?[\d]?[\d]?) (KB|MB|GB)', page, re.IGNORECASE) if trafficleft: - units = float(trafficleft.group(1)) + units = float(trafficleft.group(1).replace(",", ".")) pow = {'KB': 0, 'MB': 1, 'GB': 2}[trafficleft.group(2)] trafficleft = int(units * 1024 ** pow) else: @@ -55,4 +54,4 @@ class X7To(Account): {"redirect": "http://www.x7.to/", "id": user, "pw": data['password'], "submit": "submit"}) if "Username and password are not matching." in page: - self.wrongPassword() \ No newline at end of file + self.wrongPassword() -- cgit v1.2.3