From b20ffc3f6e6b34db2a22b6db6f751ee4a4d58a44 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 26 Oct 2014 19:39:20 +0100 Subject: Assign in-line regex to PATTERN variable in a couple of accounts --- module/plugins/accounts/QuickshareCz.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module/plugins/accounts/QuickshareCz.py') diff --git a/module/plugins/accounts/QuickshareCz.py b/module/plugins/accounts/QuickshareCz.py index adb54c7d0..f8ba3e7ff 100644 --- a/module/plugins/accounts/QuickshareCz.py +++ b/module/plugins/accounts/QuickshareCz.py @@ -15,10 +15,13 @@ class QuickshareCz(Account): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + TRAFFIC_LEFT_PATTERN = r'Stav kreditu: (.+?)' + + def loadAccountInfo(self, user, req): html = req.load("http://www.quickshare.cz/premium", decode=True) - m = re.search(r'Stav kreditu: (.+?)', html) + m = re.search(self.TRAFFIC_LEFT_PATTERN, html) if m: trafficleft = self.parseTraffic(m.group(1)) premium = True if trafficleft else False -- cgit v1.2.3