diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-02-16 21:59:10 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-02-16 21:59:10 +0100 |
commit | 8e7d14bae4d3c836f029a1235eb227380acc3f75 (patch) | |
tree | ebd0679642cccb994e70a89a106b394189cb28bc /pyload/plugin/hoster/UpleaCom.py | |
parent | Merge branch 'stable' into 0.4.10 (diff) | |
download | pyload-8e7d14bae4d3c836f029a1235eb227380acc3f75.tar.xz |
Fix plugins to work on 0.4.10
Diffstat (limited to 'pyload/plugin/hoster/UpleaCom.py')
-rw-r--r-- | pyload/plugin/hoster/UpleaCom.py | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/pyload/plugin/hoster/UpleaCom.py b/pyload/plugin/hoster/UpleaCom.py new file mode 100644 index 000000000..855d9ed65 --- /dev/null +++ b/pyload/plugin/hoster/UpleaCom.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- + +import re + +from urlparse import urljoin + +from pyload.plugin.internal.XFSHoster import XFSHoster + + +class UpleaCom(XFSHoster): + __name__ = "UpleaCom" + __type__ = "hoster" + __version__ = "0.06" + + __pattern__ = r'https?://(?:www\.)?uplea\.com/dl/\w{15}' + + __description__ = """Uplea.com hoster plugin""" + __license__ = "GPLv3" + __authors__ = [("Redleon", "")] + + + NAME_PATTERN = r'class="agmd size18">(?P<N>.+?)<' + SIZE_PATTERN = r'size14">(?P<S>[\d.,]+) (?P<U>[\w^_])</span>' + + OFFLINE_PATTERN = r'>You followed an invalid or expired link' + + LINK_PATTERN = r'"(http?://\w+\.uplea\.com/anonym/.*?)"' + + WAIT_PATTERN = r'timeText:([\d.]+),' + STEP_PATTERN = r'<a href="(/step/.+)">' + + + def setup(self): + self.multiDL = False + self.chunkLimit = 1 + self.resumeDownload = True + + + def handleFree(self, pyfile): + m = re.search(self.STEP_PATTERN, self.html) + if m is None: + self.error(_("STEP_PATTERN not found")) + + self.html = self.load(urljoin("http://uplea.com/", m.group(1))) + + m = re.search(self.WAIT_PATTERN, self.html) + if m: + self.wait(m.group(1), True) + self.retry() + + m = re.search(self.LINK_PATTERN, self.html) + if m is None: + self.error(_("LINK_PATTERN not found")) + + self.link = m.group(1) + self.wait(15) |