diff options
author | GammaC0de <GammaC0de@users.noreply.github.com> | 2015-05-29 23:49:42 +0200 |
---|---|---|
committer | GammaC0de <GammaC0de@users.noreply.github.com> | 2015-05-29 23:49:42 +0200 |
commit | 127ccbc6d9453d859b784cec28e73dfc1d54b4de (patch) | |
tree | feaeb4acc79a97c7b9fa702d87cd659f99103d6c | |
parent | Merge pull request #1 from pyload/stable (diff) | |
download | pyload-127ccbc6d9453d859b784cec28e73dfc1d54b4de.tar.xz |
[New Hoster] FileboomMe
-rw-r--r-- | module/plugins/hoster/FileboomMe.py | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/module/plugins/hoster/FileboomMe.py b/module/plugins/hoster/FileboomMe.py new file mode 100644 index 000000000..f2d3a4f61 --- /dev/null +++ b/module/plugins/hoster/FileboomMe.py @@ -0,0 +1,94 @@ +# -*- coding: utf-8 -*- + +import re + +from urlparse import urljoin +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + + +class FileboomMe(SimpleHoster): + __name__ = "FileboomMe" + __type__ = "hoster" + __version__ = "0.01" + + __pattern__ = r'https?://f(?:ile)?boom\.me/file/(?P<ID>\w+)' + + __description__ = """Fileboom.me hoster plugin""" + __license__ = "GPLv3" + __authors__ = [("GammaC0de", None)] + + + NAME_PATTERN = r'<i class="icon-download"></i>\s*(?P<N>.+?)\s*<' + SIZE_PATTERN = r'File size: (?P<S>[\d.,]+) (?P<U>[\w^_]+)' + + OFFLINE_PATTERN = r'>This file is no longer available' + WAIT_PATTERN = r'<div class="tik-tak">([\d:]+)' + LINK_PATTERN = r'/file/url\.html\?file=\w+' + + CAPTCHA_PATTERN = r'<img .* src="(/file/captcha.html\?v=\w+)"' + + + def setup(self): + self.resumeDownload = True + self.multiDL = False + self.chunkLimit = 1 + + + def handleFree(self, pyfile): + post_url = urljoin(pyfile.url, "/file/" + self.info['pattern']['ID']) + + m = re.search(r'data-slow-id="(\w+)"', self.html) + if m: + self.html = self.load(post_url, + post={'slow_id': m.group(1)}) + + m = re.search(self.LINK_PATTERN, self.html) + if m: + self.link = urljoin(pyfile.url, m.group(0)) + + else: + for _i in xrange(5): + m = re.search(r'<input type="hidden" name="uniqueId" value="(\w+)">', self.html) + if m: + uniqueId = m.group(1) + + m = re.search(self.CAPTCHA_PATTERN, self.html) + if m: + captcha = self.decryptCaptcha(urljoin(pyfile.url, m.group(1))) + + self.html = self.load(post_url, + post={'CaptchaForm[code]' : captcha, + 'free' : 1, + 'freeDownloadRequest': 1, + 'uniqueId' : uniqueId}) + + if 'The verification code is incorrect' in self.html: + self.invalidCaptcha() + + else: + self.checkErrors() + + self.html = self.load(post_url, + post={'free' : 1, + 'uniqueId': uniqueId}) + + m = re.search(self.LINK_PATTERN, self.html) + if m: + self.link = urljoin(pyfile.url, m.group(0)) + + else: + self.invalidCaptcha() + + break + + else: + self.fail(_("Captcha not found")) + + else: + break + + else: + self.fail(_("Invalid captcha")) + + +getInfo = create_getInfo(FileboomMe) |