diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-10-03 09:06:05 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-10-03 09:09:53 +0200 |
commit | 23ae563604dca1dae262fbc598154b99b2f1eae8 (patch) | |
tree | 1540b988d133c052bf0d6e7f26f02324db6f944a /module/plugins/hoster/MediafireCom.py | |
parent | [MovReelCom] Fixed LINK_PATTERN (diff) | |
download | pyload-23ae563604dca1dae262fbc598154b99b2f1eae8.tar.xz |
Update plugins after CaptchaService and XFileSharingPro changes
Diffstat (limited to 'module/plugins/hoster/MediafireCom.py')
-rw-r--r-- | module/plugins/hoster/MediafireCom.py | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py index f83003424..f2dcc909a 100644 --- a/module/plugins/hoster/MediafireCom.py +++ b/module/plugins/hoster/MediafireCom.py @@ -58,7 +58,6 @@ class MediafireCom(SimpleHoster): LINK_PATTERN = r'<div class="download_link"[^>]*(?:z-index:(?P<zindex>\d+))?[^>]*>\s*<a href="(?P<href>http://[^"]+)"' JS_KEY_PATTERN = r"DoShow\('mfpromo1'\);[^{]*{((\w+)='';.*?)eval\(\2\);" JS_ZMODULO_PATTERN = r"\('z-index'\)\) \% (\d+)\)\);" - SOLVEMEDIA_PATTERN = r'http://api\.solvemedia\.com/papi/challenge\.noscript\?k=([^"]+)' PAGE1_ACTION_PATTERN = r'<link rel="canonical" href="([^"]+)"/>' PASSWORD_PATTERN = r'<form name="form_password"' @@ -111,15 +110,12 @@ class MediafireCom(SimpleHoster): self.download(download_url) def checkCaptcha(self): - for _ in xrange(5): - m = re.search(self.SOLVEMEDIA_PATTERN, self.html) - if m: - captcha_key = m.group(1) - solvemedia = SolveMedia(self) - captcha_challenge, captcha_response = solvemedia.challenge(captcha_key) - self.html = self.load(self.url, post={"adcopy_challenge": captcha_challenge, - "adcopy_response": captcha_response}, decode=True) - else: - break - else: - self.fail("No valid recaptcha solution received") + solvemedia = SolveMedia(self) + + captcha_key = solvemedia.detect_key() + if captcha_key is None: + self.parseError("SolveMedia key not found") + + captcha_challenge, captcha_response = solvemedia.challenge(captcha_key) + self.html = self.load(self.url, post={"adcopy_challenge": captcha_challenge, + "adcopy_response": captcha_response}, decode=True) |