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/ZShareNet.py | 68 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 module/plugins/hoster/ZShareNet.py (limited to 'module/plugins/hoster/ZShareNet.py') 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:.*?(.*?)", 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 '