diff options
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r-- | module/plugins/hoster/FiledropperCom.py | 46 | ||||
-rw-r--r-- | module/plugins/hoster/FileuploadNet.py | 32 | ||||
-rw-r--r-- | module/plugins/hoster/PromptfileCom.py | 12 |
3 files changed, 83 insertions, 7 deletions
diff --git a/module/plugins/hoster/FiledropperCom.py b/module/plugins/hoster/FiledropperCom.py new file mode 100644 index 000000000..73bab2d64 --- /dev/null +++ b/module/plugins/hoster/FiledropperCom.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- + +import re +import urlparse + +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + + +class FiledropperCom(SimpleHoster): + __name__ = "FiledropperCom" + __type__ = "hoster" + __version__ = "0.01" + + __pattern__ = r'https?://(?:www\.)?filedropper\.com/\w+' + + __description__ = """Filedropper.com hoster plugin""" + __license__ = "GPLv3" + __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de")] + + + NAME_PATTERN = r'Filename: (?P<N>.+?) <' + SIZE_PATTERN = r'Size: (?P<S>[\d.,]+) (?P<U>[\w^_]+),' #@NOTE: Website says always 0 KB + OFFLINE_PATTERN = r'value="a\.swf"' + + + def setup(self): + self.multiDL = False + self.chunkLimit = 1 + + + def handleFree(self, pyfile): + m = re.search(r'img id="img" src="(.+?)"', self.html) + if m is None: + self.fail("Captcha not found") + + captcha_code = self.decryptCaptcha("http://www.filedropper.com/%s" % m.group(1)) + + m = re.search(r'method="post" action="(.+?)"', self.html) + if m is None: + self.fail("Download link not found") + + self.download(urlparse.urljoin("http://www.filedropper.com/", m.group(1)), + post={'code': captcha_code}) + + +getInfo = create_getInfo(FiledropperCom) diff --git a/module/plugins/hoster/FileuploadNet.py b/module/plugins/hoster/FileuploadNet.py new file mode 100644 index 000000000..0f2875318 --- /dev/null +++ b/module/plugins/hoster/FileuploadNet.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- + +import re + +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + + +class FileuploadNet(SimpleHoster): + __name__ = "FileuploadNet" + __type__ = "hoster" + __version__ = "0.02" + + __pattern__ = r'https?://(?:www\.)?(en\.)?file-upload\.net/download-\d+/.+' + + __description__ = """File-upload.net hoster plugin""" + __license__ = "GPLv3" + __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de")] + + + NAME_PATTERN = r'<title>File-Upload.net - (?P<N>.+?)<' + SIZE_PATTERN = r'</label><span>(?P<S>[\d.,]+) (?P<U>[\w^_]+)' + OFFLINE_PATTERN = r'Datei existiert nicht' + + LINK_FREE_PATTERN = r"<a href='(.+?)' title='download' onclick" + + + def setup(self): + self.multiDL = True + self.chunkLimit = 1 + + +getInfo = create_getInfo(FileuploadNet) diff --git a/module/plugins/hoster/PromptfileCom.py b/module/plugins/hoster/PromptfileCom.py index 3815a1a24..3578ff7fb 100644 --- a/module/plugins/hoster/PromptfileCom.py +++ b/module/plugins/hoster/PromptfileCom.py @@ -18,10 +18,10 @@ class PromptfileCom(SimpleHoster): __authors__ = [("igel", "igelkun@myopera.com")] - INFO_PATTERN = r'<span style=".+?" title=".+?">(?P<N>.*?) \((?P<S>[\d.,]+) (?P<U>[\w^_]+)\)</span>' + INFO_PATTERN = r'<span style=".+?" title=".+?">(?P<N>.*?) \((?P<S>[\d.,]+) (?P<U>[\w^_]+)\)</span>' OFFLINE_PATTERN = r'<span style=".+?" title="File Not Found">File Not Found</span>' - CHASH_PATTERN = r'<input type="hidden" name="chash" value="(.+?)" />' + CHASH_PATTERN = r'<input type="hidden" name="chash" value="(.+?)" />' LINK_FREE_PATTERN = r'<a href=\"(.+)\" target=\"_blank\" class=\"view_dl_link\">Download File</a>' @@ -30,17 +30,15 @@ class PromptfileCom(SimpleHoster): m = re.search(self.CHASH_PATTERN, self.html) if m is None: self.error(_("CHASH_PATTERN not found")) + chash = m.group(1) self.logDebug("Read chash %s" % chash) + # continue to stage2 self.html = self.load(pyfile.url, decode=True, post={'chash': chash}) # STAGE 2: get the direct link - m = re.search(self.LINK_FREE_PATTERN, self.html) - if m is None: - self.error(_("LINK_FREE_PATTERN not found")) - - self.link = m.group(1) + return super(PromptfileCom, self).handleFree(pyfile) getInfo = create_getInfo(PromptfileCom) |