From acc46fc3497a66a427b795b4a22c6e71d69185a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 13 Dec 2014 15:56:57 +0100 Subject: Update --- pyload/plugin/hoster/NosuploadCom.py | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 pyload/plugin/hoster/NosuploadCom.py (limited to 'pyload/plugin/hoster/NosuploadCom.py') diff --git a/pyload/plugin/hoster/NosuploadCom.py b/pyload/plugin/hoster/NosuploadCom.py new file mode 100644 index 000000000..02ceb65f2 --- /dev/null +++ b/pyload/plugin/hoster/NosuploadCom.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- + +import re + +from pyload.plugin.internal.XFSHoster import XFSHoster, create_getInfo + + +class NosuploadCom(XFSHoster): + __name = "NosuploadCom" + __type = "hoster" + __version = "0.31" + + __pattern = r'http://(?:www\.)?nosupload\.com/\?d=\w{12}' + + __description = """Nosupload.com hoster plugin""" + __license = "GPLv3" + __authors = [("igel", "igelkun@myopera.com")] + + + HOSTER_DOMAIN = "nosupload.com" + + SIZE_PATTERN = r'

Size: (?P[\d.,]+) (?P[\w^_]+)

' + 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.M | re.S).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.LINK_PATTERN, self.html, re.S).group(1) + + +getInfo = create_getInfo(NosuploadCom) -- cgit v1.2.3