From 2e8df8e40ae14517d28b31c044291c8a57987a4f Mon Sep 17 00:00:00 2001 From: Nitzo Date: Wed, 15 Jun 2016 01:16:11 +0300 Subject: [BigfileTo] fix #2507 --- module/plugins/accounts/BigfileTo.py | 35 +++++++++++++ module/plugins/accounts/UploadableCh.py | 34 ------------ module/plugins/crypter/BigfileToFolder.py | 30 +++++++++++ module/plugins/crypter/UploadableChFolder.py | 27 ---------- module/plugins/hoster/BigfileTo.py | 78 ++++++++++++++++++++++++++++ module/plugins/hoster/UploadableCh.py | 78 ---------------------------- 6 files changed, 143 insertions(+), 139 deletions(-) create mode 100644 module/plugins/accounts/BigfileTo.py delete mode 100644 module/plugins/accounts/UploadableCh.py create mode 100644 module/plugins/crypter/BigfileToFolder.py delete mode 100644 module/plugins/crypter/UploadableChFolder.py create mode 100644 module/plugins/hoster/BigfileTo.py delete mode 100644 module/plugins/hoster/UploadableCh.py (limited to 'module') diff --git a/module/plugins/accounts/BigfileTo.py b/module/plugins/accounts/BigfileTo.py new file mode 100644 index 000000000..23f91e1f6 --- /dev/null +++ b/module/plugins/accounts/BigfileTo.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.Account import Account + + +class BigfileTo(Account): + __name__ = "BigfileTo" + __type__ = "account" + __version__ = "0.10" + __status__ = "testing" + + __description__ = """bigfile.to account plugin""" + __license__ = "GPLv3" + __authors__ = [("Sasch" , "gsasch@gmail.com" ), + ("GammaC0de", "nitzo2001[AT]yahoo[DOT]com")] + + + def grab_info(self, user, password, data): + html = self.load("https://www.bigfile.to/login.php") + + premium = '' + NAME_PATTERN = r'
 (?P.+?)
' + OFFLINE_PATTERN = r'We are sorry... The URL you entered cannot be found on the server.' + TEMP_OFFLINE_PATTERN = r'
' diff --git a/module/plugins/crypter/UploadableChFolder.py b/module/plugins/crypter/UploadableChFolder.py deleted file mode 100644 index f108f0a4a..000000000 --- a/module/plugins/crypter/UploadableChFolder.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.SimpleCrypter import SimpleCrypter - - -class UploadableChFolder(SimpleCrypter): - __name__ = "UploadableChFolder" - __type__ = "crypter" - __version__ = "0.08" - __status__ = "testing" - - __pattern__ = r'http://(?:www\.)?uploadable\.ch/list/\w+' - __config__ = [("activated" , "bool" , "Activated" , True ), - ("use_premium" , "bool" , "Use premium account if available" , True ), - ("folder_per_package", "Default;Yes;No", "Create folder for each package" , "Default"), - ("max_wait" , "int" , "Reconnect if waiting time is greater than minutes", 10 )] - - __description__ = """Uploadable.ch folder decrypter plugin""" - __license__ = "GPLv3" - __authors__ = [("guidobelix", "guidobelix@hotmail.it"), - ("Walter Purcaro", "vuolter@gmail.com")] - - - LINK_PATTERN = r'"(.+?)" class="icon_zipfile">' - NAME_PATTERN = r'
 (?P.+?)
' - OFFLINE_PATTERN = r'We are sorry... The URL you entered cannot be found on the server.' - TEMP_OFFLINE_PATTERN = r'
' diff --git a/module/plugins/hoster/BigfileTo.py b/module/plugins/hoster/BigfileTo.py new file mode 100644 index 000000000..9bfe5dfa5 --- /dev/null +++ b/module/plugins/hoster/BigfileTo.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- + +import re + +from module.plugins.internal.misc import json +from module.plugins.captcha.ReCaptcha import ReCaptcha +from module.plugins.internal.SimpleHoster import SimpleHoster + + +class BigfileTo(SimpleHoster): + __name__ = "BigfileTo" + __type__ = "hoster" + __version__ = "0.17" + __status__ = "testing" + + __pattern__ = r'https?://(?:www\.)?(?:uploadable\.ch|bigfile.to)/file/(?P\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__ = """bigfile.to hoster plugin""" + __license__ = "GPLv3" + __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de" ), + ("Walter Purcaro", "vuolter@gmail.com" ), + ("GammaC0de" , "nitzo2001[AT]yahoo[DOT]com")] + + + URL_REPLACEMENTS = [(__pattern__ + ".*", r'https://www.bigfile.to/file/\g')] + + INFO_PATTERN = r'div id=\"file_name\" title=.*>(?P.+)\((?P[\d.]+) (?P\w+)\)<' + + OFFLINE_PATTERN = r'>(File not available|This file is no longer available)' + TEMP_OFFLINE_PATTERN = r'
' + + WAIT_PATTERN = r'>Please wait[^<]+' + + RECAPTCHA_KEY = "6LfZ0RETAAAAAOjhYT7V9ukeCT3wWccw98uc50vu" + + + def handle_free(self, pyfile): + #: Click the "free user" button and wait + json_data = json.loads(self.load(pyfile.url, post={'downloadLink': "wait"})) + + self.wait(json_data['waitTime']) + + #: Make the ReCaptcha appear and show it the pyload interface + json_data = json.loads(self.load(pyfile.url, post={'checkDownload': "check"})) + if json_data['success'] == "showCaptcha": + self.captcha = ReCaptcha(pyfile) + + 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() + + + #: Get ready for downloading + self.load(pyfile.url, post={'downloadLink': "show"}) + + #: Download the file + self.download(pyfile.url, post={'download': "normal"}, disposition=True) + + + def check_download(self): + if self.scan_download({'wait': re.compile("Please wait for")}): + self.log_info(_("Downloadlimit reached, please wait or reconnect")) + self.wait(60 * 60, True) + self.retry() + + return super(BigfileTo, self).check_download() diff --git a/module/plugins/hoster/UploadableCh.py b/module/plugins/hoster/UploadableCh.py deleted file mode 100644 index ad38af8d9..000000000 --- a/module/plugins/hoster/UploadableCh.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.captcha.ReCaptcha import ReCaptcha -from module.plugins.internal.SimpleHoster import SimpleHoster - - -class UploadableCh(SimpleHoster): - __name__ = "UploadableCh" - __type__ = "hoster" - __version__ = "0.16" - __status__ = "testing" - - __pattern__ = r'http://(?:www\.)?uploadable\.ch/file/(?P\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""" - __license__ = "GPLv3" - __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de"), - ("Walter Purcaro", "vuolter@gmail.com")] - - - URL_REPLACEMENTS = [(__pattern__ + ".*", r'http://www.uploadable.ch/file/\g')] - - INFO_PATTERN = r'div id=\"file_name\" title=.*>(?P.+)\((?P[\d.]+) (?P\w+)\)<' - - OFFLINE_PATTERN = r'>(File not available|This file is no longer available)' - TEMP_OFFLINE_PATTERN = r'
' - - WAIT_PATTERN = r'>Please wait[^<]+' - - RECAPTCHA_KEY = "6LdlJuwSAAAAAPJbPIoUhyqOJd7-yrah5Nhim5S3" - - - def handle_free(self, pyfile): - #: Click the "free user" button and wait - a = self.load(pyfile.url, post={'downloadLink': "wait"}) - self.log_debug(a) - - self.wait(30) - - #: 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"} - - self.captcha = ReCaptcha(pyfile) - - response, challenge = self.captcha.challenge(self.RECAPTCHA_KEY) - - #: 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) - - - def check_download(self): - if self.scan_download({'wait': re.compile("Please wait for")}): - self.log_info(_("Downloadlimit reached, please wait or reconnect")) - self.wait(60 * 60, True) - self.retry() - - return super(UploadableCh, self).check_download() -- cgit v1.2.3