summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/internal/XFSAccount.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugins/internal/XFSAccount.py')
-rw-r--r--pyload/plugins/internal/XFSAccount.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/pyload/plugins/internal/XFSAccount.py b/pyload/plugins/internal/XFSAccount.py
index 168c4f903..a330d2ff4 100644
--- a/pyload/plugins/internal/XFSAccount.py
+++ b/pyload/plugins/internal/XFSAccount.py
@@ -12,7 +12,7 @@ from pyload.plugins.internal.SimpleHoster import parseHtmlForm, set_cookies
class XFSAccount(Account):
__name__ = "XFSAccount"
__type__ = "account"
- __version__ = "0.30"
+ __version__ = "0.32"
__description__ = """XFileSharing account plugin"""
__license__ = "GPLv3"
@@ -27,15 +27,15 @@ class XFSAccount(Account):
PREMIUM_PATTERN = r'\(Premium only\)'
- VALID_UNTIL_PATTERN = r'>Premium.[Aa]ccount expire:.*?(\d{1,2} [\w^_]+ \d{4})'
+ VALID_UNTIL_PATTERN = r'Premium.[Aa]ccount expire:.*?(\d{1,2} [\w^_]+ \d{4})'
- TRAFFIC_LEFT_PATTERN = r'>Traffic available today:.*?<b>\s*(?P<S>[\d.,]+|[Uu]nlimited)\s*(?:(?P<U>[\w^_]+)\s*)?</b>'
+ TRAFFIC_LEFT_PATTERN = r'Traffic available today:.*?<b>\s*(?P<S>[\d.,]+|[Uu]nlimited)\s*(?:(?P<U>[\w^_]+)\s*)?</b>'
TRAFFIC_LEFT_UNIT = "MB" #: used only if no group <U> was found
LEECH_TRAFFIC_PATTERN = r'Leech Traffic left:<b>.*?(?P<S>[\d.,]+|[Uu]nlimited)\s*(?:(?P<U>[\w^_]+)\s*)?</b>'
LEECH_TRAFFIC_UNIT = "MB" #: used only if no group <U> was found
- LOGIN_FAIL_PATTERN = r'>(Incorrect Login or Password|Error<)'
+ LOGIN_FAIL_PATTERN = r'>\s*(Incorrect Login or Password|Error<)'
def init(self):
@@ -104,12 +104,12 @@ class XFSAccount(Account):
else:
self.logDebug("TRAFFIC_LEFT_PATTERN not found")
- m = re.finditer(self.LEECH_TRAFFIC_PATTERN, html)
- if m:
+ leech = [m.groupdict() for m in re.finditer(self.LEECH_TRAFFIC_PATTERN, html)]
+ if leech:
leechtraffic = 0
try:
- for leech in m:
- size = leech['S']
+ for traffic in leech:
+ size = traffic['S']
if "nlimited" in size:
leechtraffic = -1
@@ -117,8 +117,8 @@ class XFSAccount(Account):
validuntil = -1
break
else:
- if 'U' in leech:
- unit = leech['U']
+ if 'U' in traffic:
+ unit = traffic['U']
elif isinstance(self.LEECH_TRAFFIC_UNIT, basestring):
unit = self.LEECH_TRAFFIC_UNIT
else: