diff options
author | Nitzo <nitzo2001@yahoo.com> | 2016-06-15 00:16:11 +0200 |
---|---|---|
committer | Nitzo <nitzo2001@yahoo.com> | 2016-06-15 00:16:11 +0200 |
commit | 2e8df8e40ae14517d28b31c044291c8a57987a4f (patch) | |
tree | 8f2e7578ccccb4ffe870dd818962b1d877c7cfa7 /module/plugins/hoster | |
parent | [SimpleCrypter] fix #2499 (diff) | |
download | pyload-2e8df8e40ae14517d28b31c044291c8a57987a4f.tar.xz |
[BigfileTo] fix #2507
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r-- | module/plugins/hoster/BigfileTo.py (renamed from module/plugins/hoster/UploadableCh.py) | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/module/plugins/hoster/UploadableCh.py b/module/plugins/hoster/BigfileTo.py index ad38af8d9..9bfe5dfa5 100644 --- a/module/plugins/hoster/UploadableCh.py +++ b/module/plugins/hoster/BigfileTo.py @@ -2,30 +2,32 @@ import re +from module.plugins.internal.misc import json from module.plugins.captcha.ReCaptcha import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster -class UploadableCh(SimpleHoster): - __name__ = "UploadableCh" +class BigfileTo(SimpleHoster): + __name__ = "BigfileTo" __type__ = "hoster" - __version__ = "0.16" + __version__ = "0.17" __status__ = "testing" - __pattern__ = r'http://(?:www\.)?uploadable\.ch/file/(?P<ID>\w+)' + __pattern__ = r'https?://(?:www\.)?(?:uploadable\.ch|bigfile.to)/file/(?P<ID>\w+)' __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__ = """Uploadable.ch hoster plugin""" + __description__ = """bigfile.to hoster plugin""" __license__ = "GPLv3" - __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de"), - ("Walter Purcaro", "vuolter@gmail.com")] + __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de" ), + ("Walter Purcaro", "vuolter@gmail.com" ), + ("GammaC0de" , "nitzo2001[AT]yahoo[DOT]com")] - URL_REPLACEMENTS = [(__pattern__ + ".*", r'http://www.uploadable.ch/file/\g<ID>')] + URL_REPLACEMENTS = [(__pattern__ + ".*", r'https://www.bigfile.to/file/\g<ID>')] INFO_PATTERN = r'div id=\"file_name\" title=.*>(?P<N>.+)<span class=\"filename_normal\">\((?P<S>[\d.]+) (?P<U>\w+)\)</span><' @@ -34,37 +36,35 @@ class UploadableCh(SimpleHoster): WAIT_PATTERN = r'>Please wait[^<]+' - RECAPTCHA_KEY = "6LdlJuwSAAAAAPJbPIoUhyqOJd7-yrah5Nhim5S3" + RECAPTCHA_KEY = "6LfZ0RETAAAAAOjhYT7V9ukeCT3wWccw98uc50vu" def handle_free(self, pyfile): #: Click the "free user" button and wait - a = self.load(pyfile.url, post={'downloadLink': "wait"}) - self.log_debug(a) + json_data = json.loads(self.load(pyfile.url, post={'downloadLink': "wait"})) - self.wait(30) + self.wait(json_data['waitTime']) #: Make the ReCaptcha appear and show it the pyload interface - b = self.load(pyfile.url, post={'checkDownload': "check"}) - self.log_debug(b) #: Expected output: {'success': "showCaptcha"} + json_data = json.loads(self.load(pyfile.url, post={'checkDownload': "check"})) + if json_data['success'] == "showCaptcha": + self.captcha = ReCaptcha(pyfile) - self.captcha = ReCaptcha(pyfile) + response, challenge = self.captcha.challenge(self.RECAPTCHA_KEY) - response, challenge = self.captcha.challenge(self.RECAPTCHA_KEY) + #: Submit the captcha solution + json_data = json.loads(self.load("https://www.bigfile.to/checkReCaptcha.php", + post={'recaptcha_challenge_field' : challenge, + 'recaptcha_response_field' : response, + 'recaptcha_shortencode_field': self.info['pattern']['ID']})) + self.log_debug("json_data", json_data) + if json_data['success'] != 1: + self.retry_captcha() - #: Submit the captcha solution - self.load("http://www.uploadable.ch/checkReCaptcha.php", - post={'recaptcha_challenge_field' : challenge, - 'recaptcha_response_field' : response, - 'recaptcha_shortencode_field': self.info['pattern']['ID']}) - - self.wait(3) #: Get ready for downloading self.load(pyfile.url, post={'downloadLink': "show"}) - self.wait(3) - #: Download the file self.download(pyfile.url, post={'download': "normal"}, disposition=True) @@ -75,4 +75,4 @@ class UploadableCh(SimpleHoster): self.wait(60 * 60, True) self.retry() - return super(UploadableCh, self).check_download() + return super(BigfileTo, self).check_download() |