summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-03-28 14:43:05 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-03-28 14:43:05 +0200
commit96c58d017e76e247dd17ccbd4819dfebdace3ffa (patch)
tree188c200fbb85423d552faf91f5dc4021a03ca8e9 /module/plugins/hoster
parentimplemented ul api (diff)
downloadpyload-96c58d017e76e247dd17ccbd4819dfebdace3ffa.tar.xz
FileApe, zShare plugin
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r--module/plugins/hoster/FileApeCom.py62
-rw-r--r--module/plugins/hoster/ZShareNet.py68
2 files changed, 130 insertions, 0 deletions
diff --git a/module/plugins/hoster/FileApeCom.py b/module/plugins/hoster/FileApeCom.py
new file mode 100644
index 000000000..1f933e776
--- /dev/null
+++ b/module/plugins/hoster/FileApeCom.py
@@ -0,0 +1,62 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import re
+
+from module.plugins.Hoster import Hoster
+
+class FileApeCom(Hoster):
+ __name__ = "FileApeCom"
+ __type__ = "hoster"
+ __pattern__ = r"http://(www\.)?fileape\.com/(index\.php\?act=download\&id=|dl/)\w+"
+ __version__ = "0.1"
+ __description__ = """FileApe Download Hoster"""
+ __author_name__ = ("espes")
+
+ def setup(self):
+ self.multiDL = False
+ self.html = None
+
+ def process(self, pyfile):
+ self.pyfile = pyfile
+
+ self.html = self.load(self.pyfile.url)
+
+ if "This file is either temporarily unavailable or does not exist" in self.html:
+ self.offline()
+
+ self.html = self.load(self.pyfile.url+"&g=1")
+
+ continueMatch = re.search(r"window\.location = '(http://.*?)'", self.html)
+ if not continueMatch:
+ continueMatch = re.search(r"'(http://fileape\.com/\?act=download&t=[A-Za-z0-9_-]+)'", self.html)
+ if continueMatch:
+ continuePage = continueMatch.group(1)
+ else:
+ self.fail("Plugin Defect")
+
+ wait = 60
+ waitMatch = re.search("id=\"waitnumber\" style=\"font-size:2em; text-align:center; width:33px; height:33px;\">(\\d+)</span>", self.html)
+ if waitMatch:
+ wait = int(waitMatch.group(1))
+ self.setWait(wait+3)
+ self.wait()
+
+ self.html = self.load(continuePage)
+ linkMatch = \
+ re.search(r"<div style=\"text-align:center; font-size: 30px;\"><a href=\"(http://.*?)\"", self.html)
+ if not linkMatch:
+ linkMatch = re.search(r"\"(http://tx\d+\.fileape\.com/[a-z]+/.*?)\"", self.html)
+ if linkMatch:
+ link = linkMatch.group(1)
+ else:
+ self.fail("Plugin Defect")
+
+ pyfile.name = link.rpartition('/')[2]
+
+ self.download(link)
+
+ check = self.checkDownload({"exp": "Download ticket expired"})
+ if check == "exp":
+ self.log.info("Ticket expired, retrying...")
+ self.retry() \ No newline at end of file
diff --git a/module/plugins/hoster/ZShareNet.py b/module/plugins/hoster/ZShareNet.py
new file mode 100644
index 000000000..d3453ee5e
--- /dev/null
+++ b/module/plugins/hoster/ZShareNet.py
@@ -0,0 +1,68 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import re
+import random
+
+from module.utils import parseFileSize
+from module.plugins.Hoster import Hoster
+
+class ZShareNet(Hoster):
+ __name__ = "ZShareNet"
+ __type__ = "hoster"
+ __pattern__ = r"http://[\w\.]*?zshare\.net/(download|video|image|audio|flash)/.*"
+ __version__ = "0.1"
+ __description__ = """ZShareNet Download Hoster"""
+ __author_name__ = ("espes")
+
+ def setup(self):
+ self.multiDL = False
+ self.html = None
+
+ def process(self, pyfile):
+ self.pyfile = pyfile
+
+ self.html = self.load(pyfile.url)
+ if "File Not Found" in self.html:
+ self.offline()
+
+ filenameMatch = re.search("File Name:.*?<font color=\"#666666\".*?>(.*?)</font>", self.html, re.DOTALL)
+ filesizeMatch = re.search("File Size:.*?<font color=\"#666666\".*?>([^<]+)</font>", self.html, re.DOTALL)
+ if not filenameMatch or not filesizeMatch:
+ self.offline()
+ filename = filenameMatch.group(1)
+ filesize = filesizeMatch.group(1)
+ if filename.strip() == "":
+ self.offline()
+
+ pyfile.name = filename
+
+ pyfile.size = parseFileSize(filesize)
+
+ if '<input name="download"' not in self.html:
+ self.fail("No download form")
+
+ self.html = self.load(pyfile.url, post={
+ "download": 1,
+ "imageField.x": random.randrange(160),
+ "imageField.y": random.randrange(60)})
+
+ dllinkMatch = re.search("var link_enc\\=new Array\\(\\'(.*?)\\'\\)", self.html)
+ if dllinkMatch:
+ dllink = re.sub("\\'\\,\\'", "", dllinkMatch.group(1))
+ else:
+ self.fail("Plugin defect")
+
+ self.setWait(51)
+ self.wait()
+
+ self.download(dllink)
+ check = self.checkDownload({
+ "unav": "/images/download.gif",
+ "404": "404 - Not Found"
+ })
+ #print check
+ if check == "unav":
+ self.fail("Plugin defect")
+ elif check == "404":
+ self.offline() \ No newline at end of file