summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2010-05-08 00:46:20 +0200
committerGravatar mkaay <mkaay@mkaay.de> 2010-05-08 00:46:20 +0200
commit206d8f15d0d4dda37058f1084a2ff839e55ff77d (patch)
tree2f8b202c18d3eafca5aa7eaadcca26994089dde0
parentfix (diff)
downloadpyload-206d8f15d0d4dda37058f1084a2ff839e55ff77d.tar.xz
ShaernowNet plugin
-rw-r--r--module/config/core_default.xml1
-rw-r--r--module/plugins/hoster/SharenowNet.py65
2 files changed, 66 insertions, 0 deletions
diff --git a/module/config/core_default.xml b/module/config/core_default.xml
index abfe5c986..783818502 100644
--- a/module/config/core_default.xml
+++ b/module/config/core_default.xml
@@ -111,6 +111,7 @@
module.plugins.hoster.YoutubeCom,
module.plugins.hoster.ZippyshareCom,
module.plugins.hoster.ZshareNet,
+ module.plugins.hoster.SharenowNet,
</load_hoster_plugins>
<load_account_plugins>
module.plugins.accounts.RapidshareCom,
diff --git a/module/plugins/hoster/SharenowNet.py b/module/plugins/hoster/SharenowNet.py
new file mode 100644
index 000000000..9eb0a9f9e
--- /dev/null
+++ b/module/plugins/hoster/SharenowNet.py
@@ -0,0 +1,65 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import re
+from module.plugins.Hoster import Hoster
+from module.unescape import unescape
+
+class SharenowNet(Hoster):
+ __name__ = "SharenowNet"
+ __type__ = "hoster"
+ __pattern__ = r'http://(www\.)?share-now\.net/files/\d+-.*?\.html'
+ __version__ = "0.1"
+ __description__ = """Share-Now.net Download Hoster"""
+ __author_name__ = ("jeix")
+ __author_mail__ = ("jeix@hasnomail.de")
+
+ def __init__(self, parent):
+ Hoster.__init__(self, parent)
+ self.parent = parent
+ self.html = None
+ self.multi_dl = False
+
+ def proceed(self, url, location):
+ postData = {"Submit":"Download+Now",}
+ dval = re.search(r'name="download" value="(.*?)"/>', self.html).group(1)
+ if "Sicherheitscode eingeben" in self.html:
+ # download captcha
+
+ # get captcha code
+ dval = "captchacode"
+
+ postData["download"] = dval
+ self.download(url, location, cookies=False, post=postData)
+
+ def download_html(self):
+ self.url = self.parent.url
+ self.html = self.load(self.url)
+
+ def get_file_url(self):
+ """ returns the absolute downloadable filepath
+ """
+ if self.html == None:
+ self.download_html()
+
+ return re.search(r'method="post" action="(http://.*?\.share-now\.net/download\.php)">', self.html).group(1)
+
+ def get_file_name(self):
+ if self.html == None:
+ self.download_html()
+
+ name = re.search(r'<span class="style1">Download -> (.*?)</span>', self.html, re.DOTALL).group(1)
+ name = "%s" % unescape(name.encode("ascii", "ignore")).decode("utf-8").encode("ascii", "ignore").replace("+", " ")
+ return name
+
+ def file_exists(self):
+ """ returns True or False
+ """
+ if self.html == None:
+ self.download_html()
+
+ if re.search(r'name="download" value="(.*?)"/>', self.html) == None:
+ return False
+ else:
+ return True
+