diff options
author | GamaC0de <nitzo2001@yahoo.com> | 2016-05-11 00:01:54 +0200 |
---|---|---|
committer | GamaC0de <nitzo2001@yahoo.com> | 2016-05-11 00:01:54 +0200 |
commit | 58dcbf4fc8982ae05952a724048f61622be1cdff (patch) | |
tree | 9eb3f1539aec01161c92ca0ef02c6e16492899b5 /module | |
parent | [ShareonlineBiz] fix #2456 (diff) | |
download | pyload-58dcbf4fc8982ae05952a724048f61622be1cdff.tar.xz |
[New hoster] [ClicknuploadCom] fix #2458
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/hoster/ClicknuploadCom.py | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/module/plugins/hoster/ClicknuploadCom.py b/module/plugins/hoster/ClicknuploadCom.py new file mode 100644 index 000000000..f9ac74e6d --- /dev/null +++ b/module/plugins/hoster/ClicknuploadCom.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- + +import re + +from module.plugins.internal.SimpleHoster import SimpleHoster + + +class ClicknuploadCom(SimpleHoster): + __name__ = "ClicknuploadCom" + __type__ = "hoster" + __version__ = "0.03" + __status__ = "testing" + + __pattern__ = r'http://(?:www\.)?clicknupload\.(?:com|me|link)/\w{12}' + __config__ = [("activated" , "bool", "Activated" , True), + ("use_premium" , "bool", "Use premium account if available" , True), + ("fallback" , "bool", "Fallback to free download if premium fails" , True), + ("chk_filesize", "bool", "Check file size" , True), + ("max_wait" , "int" , "Reconnect if waiting time is greater than minutes", 10 )] + + __description__ = """Clicknupload.com hoster plugin""" + __license__ = "GPLv3" + __authors__ = [("tbsn" , "tbsnpy_github@gmx.de" ), + ("GammaC0de", "nitzo2001[AT]yahoo[DOT]com")] + + NAME_PATTERN = r'name="fname" value="(?P<N>.+?)">' + SIZE_PATTERN = r'<b>Size: (?P<S>[\d.,]+) (?P<U>[\w^_]+)' + LINK_PATTERN = r'onClick="window.open\(\'(.+?)\'\);"' + + OFFLINE_PATTERN = r'<b>File Not Found</b>' + + WAIT_PATTERN = r'>Please wait <.+?>(\d+)<' + + URL_REPLACEMENTS = [(r'clicknupload\.(?:me|com)', "clicknupload.link")] + + + def handle_free(self, pyfile): + action, inputs = self.parse_html_form("action=''") + if not inputs: + self.log_debug(_("Form 1 not found")) + + self.data = self.load(pyfile.url, post=inputs) + + self.check_errors() + + action, inputs = self.parse_html_form('name="F1"') + if not inputs: + self.log_debug(_("Form 2 not found")) + + self.data = self.load(pyfile.url, post=inputs) + + m = re.search(self.LINK_PATTERN, self.data) + if m: + self.link = m.group(1) |