diff options
author | zoidberg10 <zoidberg@mujmail.cz> | 2011-11-23 15:28:44 +0100 |
---|---|---|
committer | zoidberg10 <zoidberg@mujmail.cz> | 2011-11-23 15:28:44 +0100 |
commit | 02c58f1009cc7f6b7ee36f1a34e43bec02735f05 (patch) | |
tree | 10fa0f86b54119769912ae2bc52775c0342d0f5f /module/plugins/hoster/FshareVn.py | |
parent | fix 4shared, replace easy-share with crocko (diff) | |
download | pyload-02c58f1009cc7f6b7ee36f1a34e43bec02735f05.tar.xz |
add uploadbox.com, fshare.vn
Diffstat (limited to 'module/plugins/hoster/FshareVn.py')
-rw-r--r-- | module/plugins/hoster/FshareVn.py | 42 |
1 files changed, 42 insertions, 0 deletions
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'<p><b>Tên file:</b>\s*(?P<N>[^<]+)</p>\s*<p><b>Dung lượng file:</b>\s*(?P<S>[0-9,.]+)\s*(?P<U>[kKMG])i?B</p>' + FILE_OFFLINE_PATTERN = r'<span class="error_number">511</span>' + + DOWNLOAD_URL_PATTERN = r"<a class=\"bt_down\" id=\"down\".*window.location='([^']+)'\">" + FORM_PATTERN = r'<form action="" method="post" name="frm_download">(.*?)</form>' + FORM_INPUT_PATTERN = r'<input[^>]* 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 |