From 96c58d017e76e247dd17ccbd4819dfebdace3ffa Mon Sep 17 00:00:00 2001 From: RaNaN Date: Mon, 28 Mar 2011 14:43:05 +0200 Subject: FileApe, zShare plugin --- module/plugins/hoster/FileApeCom.py | 62 +++++++++++++++++++++++++++++++++ module/plugins/hoster/ZShareNet.py | 68 +++++++++++++++++++++++++++++++++++++ 2 files changed, 130 insertions(+) create mode 100644 module/plugins/hoster/FileApeCom.py create mode 100644 module/plugins/hoster/ZShareNet.py (limited to 'module/plugins/hoster') 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+)", self.html) + if waitMatch: + wait = int(waitMatch.group(1)) + self.setWait(wait+3) + self.wait() + + self.html = self.load(continuePage) + linkMatch = \ + re.search(r"
(.*?)", self.html, re.DOTALL) + filesizeMatch = re.search("File Size:.*?([^<]+)", 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 '