diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-05-24 02:54:59 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-05-24 02:54:59 +0200 |
commit | 6f7a8c2d48ffb8dcf6b00eef2dd48df0a5d84e3b (patch) | |
tree | 40e52448eda74624c3258e91f008f48a833944b1 /module/plugins/hoster | |
parent | [UserAgentSwitcher] Fixup (diff) | |
download | pyload-6f7a8c2d48ffb8dcf6b00eef2dd48df0a5d84e3b.tar.xz |
[MediafireCom] ReCaptcha
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r-- | module/plugins/hoster/MediafireCom.py | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py index c022918ae..0e63963d3 100644 --- a/module/plugins/hoster/MediafireCom.py +++ b/module/plugins/hoster/MediafireCom.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.CaptchaService import SolveMedia +from module.plugins.internal.CaptchaService import SolveMedia, ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class MediafireCom(SimpleHoster): __name__ = "MediafireCom" __type__ = "hoster" - __version__ = "0.86" + __version__ = "0.87" __pattern__ = r'https?://(?:www\.)?mediafire\.com/(file/|view/\??|download(\.php\?|/)|\?)\w{15}' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -34,16 +34,30 @@ class MediafireCom(SimpleHoster): self.multiDL = True - def handleFree(self, pyfile): + def handleCaptcha(self): solvemedia = SolveMedia(self) captcha_key = solvemedia.detect_key() if captcha_key: response, challenge = solvemedia.challenge(captcha_key) - self.html = self.load(pyfile.url, + self.html = self.load(self.pyfile.url, post={'adcopy_challenge': challenge, 'adcopy_response' : response}, decode=True) + return + + recaptcha = ReCaptcha(self) + captcha_key = recaptcha.detect_key() + + if captcha_key: + response, challenge = recaptcha.challenge(captcha_key) + self.html = self.load(self.pyfile.url, + post={'g-recaptcha-response': response}, + decode=True) + + + def handleFree(self, pyfile): + self.handleCaptcha() if self.PASSWORD_PATTERN in self.html: password = self.getPassword() |