From 02c58f1009cc7f6b7ee36f1a34e43bec02735f05 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Wed, 23 Nov 2011 15:28:44 +0100 Subject: add uploadbox.com, fshare.vn --- module/plugins/hoster/FshareVn.py | 42 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 module/plugins/hoster/FshareVn.py (limited to 'module/plugins/hoster/FshareVn.py') diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py new file mode 100644 index 000000000..13f15716f --- /dev/null +++ b/module/plugins/hoster/FshareVn.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo +import re + +class FshareVn(SimpleHoster): + __name__ = "FshareVn" + __type__ = "hoster" + __pattern__ = r"http://(www\.)?fshare.vn/file/.*" + __version__ = "0.10" + __description__ = """FshareVn Download Hoster""" + __author_name__ = ("zoidberg") + __author_mail__ = ("zoidberg@mujmail.cz") + + FILE_INFO_PATTERN = ur'

Tên file:\s*(?P[^<]+)

\s*

Dung lượng file:\s*(?P[0-9,.]+)\s*(?P[kKMG])i?B

' + FILE_OFFLINE_PATTERN = r'511' + + DOWNLOAD_URL_PATTERN = r"" + FORM_PATTERN = r'
(.*?)
' + FORM_INPUT_PATTERN = r']* name="?([^" ]+)"? value="?([^" ]+)"?[^>]*>' + + def handleFree(self): + found = re.search(self.FORM_PATTERN, self.html, re.DOTALL) + if not found: self.parseError('FORM') + form = found.group(1) + inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form)) + + self.html = self.load(self.pyfile.url, post = inputs) + + found = re.search(self.DOWNLOAD_URL_PATTERN, self.html) + if not found: self.parseError('Free URL') + url = found.group(1) + + found = re.search(r'var count = (\d+)', self.html) + self.setWait(int(found.group(1)) if found else 30) + self.wait() + + self.download(url) + +getInfo = create_getInfo(FshareVn) + \ No newline at end of file -- cgit v1.2.3