Repository navigation
Expand file tree
/
Copy pathClicknuploadCom.py
More file actions
54 lines (37 loc) · 1.91 KB
/
Copy pathClicknuploadCom.py
File metadata and controls
54 lines (37 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# -*- coding: utf-8 -*-
import re
from module.plugins.internal.SimpleHoster import SimpleHoster
class ClicknuploadCom(SimpleHoster):
__name__ = "ClicknuploadCom"
__type__ = "hoster"
__version__ = "0.04"
__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.fail(_("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.fail(_("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)