From e88c477d1ae3913096b92f41274ef578693bc052 Mon Sep 17 00:00:00 2001 From: Stefano Date: Mon, 21 Apr 2014 17:26:28 +0200 Subject: Moving new plugins from module to pyload --- pyload/plugins/hoster/NosuploadCom.py | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 pyload/plugins/hoster/NosuploadCom.py (limited to 'pyload/plugins/hoster/NosuploadCom.py') diff --git a/pyload/plugins/hoster/NosuploadCom.py b/pyload/plugins/hoster/NosuploadCom.py new file mode 100644 index 000000000..1de734222 --- /dev/null +++ b/pyload/plugins/hoster/NosuploadCom.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- + +import re + +from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo + + +class NosuploadCom(XFileSharingPro): + __name__ = "NosuploadCom" + __type__ = "hoster" + __version__ = "0.1" + __pattern__ = r'http://(?:www\.)?nosupload\.com/\?d=\w{12}' + __description__ = """Nosupload.com hoster plugin""" + __author_name__ = "igel" + __author_mail__ = "igelkun@myopera.com" + + HOSTER_NAME = "nosupload.com" + + FILE_SIZE_PATTERN = r'

Size: (?P[0-9\.]+) (?P[kKMG]?B)

' + DIRECT_LINK_PATTERN = r'Download' + WAIT_PATTERN = r'Please wait.*?>(\d+)' + + def getDownloadLink(self): + # stage1: press the "Free Download" button + data = self.getPostParameters() + self.html = self.load(self.pyfile.url, post=data, ref=True, decode=True) + + # stage2: wait some time and press the "Download File" button + data = self.getPostParameters() + wait_time = re.search(self.WAIT_PATTERN, self.html, re.MULTILINE | re.DOTALL).group(1) + self.logDebug("hoster told us to wait %s seconds" % wait_time) + self.wait(wait_time) + self.html = self.load(self.pyfile.url, post=data, ref=True, decode=True) + + # stage3: get the download link + return re.search(self.DIRECT_LINK_PATTERN, self.html, re.S).group(1) + + +getInfo = create_getInfo(NosuploadCom) -- cgit v1.2.3