From 58dcbf4fc8982ae05952a724048f61622be1cdff Mon Sep 17 00:00:00 2001 From: GamaC0de Date: Wed, 11 May 2016 01:01:54 +0300 Subject: [New hoster] [ClicknuploadCom] fix #2458 --- module/plugins/hoster/ClicknuploadCom.py | 54 ++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 module/plugins/hoster/ClicknuploadCom.py (limited to 'module') 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.+?)">' + SIZE_PATTERN = r'Size: (?P[\d.,]+) (?P[\w^_]+)' + LINK_PATTERN = r'onClick="window.open\(\'(.+?)\'\);"' + + OFFLINE_PATTERN = r'File Not Found' + + 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) -- cgit v1.2.3