summaryrefslogtreecommitdiffstats
path: root/pyload/plugin/hoster/NosuploadCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugin/hoster/NosuploadCom.py')
-rw-r--r--pyload/plugin/hoster/NosuploadCom.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/pyload/plugin/hoster/NosuploadCom.py b/pyload/plugin/hoster/NosuploadCom.py
new file mode 100644
index 000000000..af79da22b
--- /dev/null
+++ b/pyload/plugin/hoster/NosuploadCom.py
@@ -0,0 +1,39 @@
+# -*- coding: utf-8 -*-
+
+import re
+
+from pyload.plugin.internal.XFSHoster import XFSHoster
+
+
+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")]
+
+
+ SIZE_PATTERN = r'<p><strong>Size:</strong> (?P<S>[\d.,]+) (?P<U>[\w^_]+)</p>'
+ LINK_PATTERN = r'<a class="select" href="(http://.+?)">Download</a>'
+
+ WAIT_PATTERN = r'Please wait.*?>(\d+)</span>'
+
+
+ def getDownloadLink(self):
+ # stage1: press the "Free Download" button
+ data = self.getPostParameters()
+ self.html = self.load(self.pyfile.url, post=data, 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, decode=True)
+
+ # stage3: get the download link
+ return re.search(self.LINK_PATTERN, self.html, re.S).group(1)