summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/NosuploadCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/NosuploadCom.py')
-rw-r--r--module/plugins/hoster/NosuploadCom.py31
1 files changed, 18 insertions, 13 deletions
diff --git a/module/plugins/hoster/NosuploadCom.py b/module/plugins/hoster/NosuploadCom.py
index 1de734222..8a03d7090 100644
--- a/module/plugins/hoster/NosuploadCom.py
+++ b/module/plugins/hoster/NosuploadCom.py
@@ -2,24 +2,29 @@
import re
-from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
+from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo
-class NosuploadCom(XFileSharingPro):
- __name__ = "NosuploadCom"
- __type__ = "hoster"
- __version__ = "0.1"
+class NosuploadCom(XFSHoster):
+ __name__ = "NosuploadCom"
+ __type__ = "hoster"
+ __version__ = "0.31"
+
__pattern__ = r'http://(?:www\.)?nosupload\.com/\?d=\w{12}'
+
__description__ = """Nosupload.com hoster plugin"""
- __author_name__ = "igel"
- __author_mail__ = "igelkun@myopera.com"
+ __license__ = "GPLv3"
+ __authors__ = [("igel", "igelkun@myopera.com")]
+
- HOSTER_NAME = "nosupload.com"
+ HOSTER_DOMAIN = "nosupload.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>'
- FILE_SIZE_PATTERN = r'<p><strong>Size:</strong> (?P<S>[0-9\.]+) (?P<U>[kKMG]?B)</p>'
- DIRECT_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()
@@ -27,13 +32,13 @@ class NosuploadCom(XFileSharingPro):
# 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)
+ 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.DIRECT_LINK_PATTERN, self.html, re.S).group(1)
+ return re.search(self.LINK_PATTERN, self.html, re.S).group(1)
getInfo = create_getInfo(NosuploadCom)