From cc5accb444abc29bd0e23e6a0f78cf5f5a993640 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 30 Apr 2015 19:20:11 +0200 Subject: Spare code cosmetics --- module/plugins/hoster/UpleaCom.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'module/plugins/hoster/UpleaCom.py') diff --git a/module/plugins/hoster/UpleaCom.py b/module/plugins/hoster/UpleaCom.py index 608282a60..4538b1c16 100644 --- a/module/plugins/hoster/UpleaCom.py +++ b/module/plugins/hoster/UpleaCom.py @@ -22,18 +22,19 @@ class UpleaCom(XFSHoster): DISPOSITION = False #@TODO: Remove in 0.4.10 - NAME_PATTERN = r'(?P.+?)' - SIZE_PATTERN = r'(?P[\d.,]+) (?P[\w^_]+?)' + HOSTER_DOMAIN = "uplea.com" + SIZE_REPLACEMENTS = [('ko','KB'), ('mo','MB'), ('go','GB'), ('Ko','KB'), ('Mo','MB'), ('Go','GB')] + NAME_PATTERN = r'(?P.+?)' + SIZE_PATTERN = r'(?P[\d.,]+) (?P[\w^_]+?)' OFFLINE_PATTERN = r'>You followed an invalid or expired link' - PREMIUM_PATTERN = r'You need to have a Premium subscription to download this file' LINK_PATTERN = r'"(https?://\w+\.uplea\.com/anonym/.*?)"' - HOSTER_DOMAIN = "uplea.com" - WAIT_PATTERN = r'timeText: ?([\d.]+),' - STEP_PATTERN = r'' + PREMIUM_ONLY_PATTERN = r'You need to have a Premium subscription to download this file' + WAIT_PATTERN = r'timeText: ?([\d.]+),' + STEP_PATTERN = r'' def setup(self): @@ -55,10 +56,6 @@ class UpleaCom(XFSHoster): self.wait(m.group(1), True) self.retry() - m = re.search(self.PREMIUM_PATTERN, self.html) - if m: - self.error(_("This URL requires a premium account")) - m = re.search(self.LINK_PATTERN, self.html) if m is None: self.error(_("LINK_PATTERN not found")) -- cgit v1.2.3