From 3c9f55270a83b0e88ec0dc516f9d9921e4d7b6ea Mon Sep 17 00:00:00 2001 From: mkaay Date: Wed, 25 Aug 2010 16:48:55 +0200 Subject: merged gui --- core/module/plugins/hoster/FileserveCom.py | 92 ++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 core/module/plugins/hoster/FileserveCom.py (limited to 'core/module/plugins/hoster/FileserveCom.py') diff --git a/core/module/plugins/hoster/FileserveCom.py b/core/module/plugins/hoster/FileserveCom.py new file mode 100644 index 000000000..ff09d9a0a --- /dev/null +++ b/core/module/plugins/hoster/FileserveCom.py @@ -0,0 +1,92 @@ +# -*- coding: utf-8 -*- + +import re +from module.plugins.Hoster import Hoster +from module.plugins.ReCaptcha import ReCaptcha + +from module.network.Request import getURL + +def getInfo(urls): + result = [] + + for url in urls: + html = getURL(url) + if re.search(r'

File not available

', html): + result.append((url, 0, 1, url)) + continue + + size = re.search(r"(.*?) MB", html).group(1) + size = int(float(size)*1024*1024) + + name = re.search('

(.*?)

', html).group(1) + result.append((name, size, 2, url)) + + yield result + +class FileserveCom(Hoster): + __name__ = "FileserveCom" + __type__ = "hoster" + __pattern__ = r"http://(www\.)?fileserve\.com/file/.*?(/.*)?" + __version__ = "0.2" + __description__ = """Fileserve.Com File Download Hoster""" + __author_name__ = ("jeix", "mkaay") + __author_mail__ = ("jeix@hasnomail.de", "mkaay@mkaay.de") + + def setup(self): + self.req.canContinue = self.multiDL = True if self.account else False + + def process(self, pyfile): + + self.html = self.load(self.pyfile.url, cookies=False if self.account else True) + if re.search(r'

File not available

', self.html) != None: + self.offline + + self.pyfile.name = re.search('

(.*?)

', self.html).group(1) + + if self.account: + self.handlePremium() + else: + self.handleFree() + + def handlePremium(self): + self.download(self.pyfile.url, post={"download":"premium"}, cookies=True) + + def handleFree(self): + + if r'