From 6cd0159921cf420f68ad1deb17d089e67d79d802 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Fri, 24 Apr 2015 05:36:13 +0300 Subject: Update UpleaCom.py --- module/plugins/hoster/UpleaCom.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/module/plugins/hoster/UpleaCom.py b/module/plugins/hoster/UpleaCom.py index 59c593c93..b79456ebe 100644 --- a/module/plugins/hoster/UpleaCom.py +++ b/module/plugins/hoster/UpleaCom.py @@ -10,23 +10,26 @@ from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo class UpleaCom(XFSHoster): __name__ = "UpleaCom" __type__ = "hoster" - __version__ = "0.06" + __version__ = "0.07" __pattern__ = r'https?://(?:www\.)?uplea\.com/dl/\w{15}' __description__ = """Uplea.com hoster plugin""" __license__ = "GPLv3" - __authors__ = [("Redleon", None)] + __authors__ = [("Redleon", None), + ("GammaC0de", None)] NAME_PATTERN = r'class="agmd size18">(?P.+?)<' - SIZE_PATTERN = r'size14">(?P[\d.,]+) (?P[\w^_])' + SIZE_PATTERN = r'size14">(?P[\d.,]+) (?P[\w^_]+?)' + SIZE_REPLACEMENTS = [('Ko','KB'), ('Mo','MB'), ('Go','GB')] 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'"(http?://\w+\.uplea\.com/anonym/.*?)"' + LINK_PATTERN = r'"(https?://\w+\.uplea\.com/anonym/.*?)"' - WAIT_PATTERN = r'timeText:([\d.]+),' + WAIT_PATTERN = r'timeText: ?([\d.]+),' STEP_PATTERN = r'' @@ -45,9 +48,14 @@ class UpleaCom(XFSHoster): m = re.search(self.WAIT_PATTERN, self.html) if m: - self.wait(m.group(1), True) + self.logDebug(_("Waiting %s seconds") % m.group(1)) + self.wait(int(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 From 76dea6e0faffbb7343b36c9230d7dee3a1db0f89 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Fri, 24 Apr 2015 05:41:28 +0300 Subject: Update UpleaCom.py --- module/plugins/hoster/UpleaCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/plugins/hoster/UpleaCom.py b/module/plugins/hoster/UpleaCom.py index b79456ebe..039d2f552 100644 --- a/module/plugins/hoster/UpleaCom.py +++ b/module/plugins/hoster/UpleaCom.py @@ -49,7 +49,7 @@ class UpleaCom(XFSHoster): m = re.search(self.WAIT_PATTERN, self.html) if m: self.logDebug(_("Waiting %s seconds") % m.group(1)) - self.wait(int(m.group(1)), True) + self.wait(m.group(1), True) self.retry() m = re.search(self.PREMIUM_PATTERN, self.html) -- cgit v1.2.3