From c484718f06c0d9dbb5b820189a581445dec012d1 Mon Sep 17 00:00:00 2001 From: zapp-brannigan Date: Sun, 27 Jul 2014 17:36:47 +0200 Subject: [Uploadable.ch] New hoster As requested in https://github.com/pyload/pyload/issues/679 --- module/plugins/hoster/UploadableCh.py | 82 +++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 module/plugins/hoster/UploadableCh.py (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/UploadableCh.py b/module/plugins/hoster/UploadableCh.py new file mode 100644 index 000000000..9d44b17db --- /dev/null +++ b/module/plugins/hoster/UploadableCh.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- +#Testlink: +#http://www.uploadable.ch/file/JG3nbN6fUCvh/test.txt +# +import re,time +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo +from module.plugins.ReCaptcha import ReCaptcha + +class UploadableCh(SimpleHoster): + __name__ = "UploadableCh" + __type__ = "hoster" + __pattern__ = r"https?://www.uploadable.ch/file/.*" + __version__ = "0.01" + __description__ = """uploadable.ch hoster plugin""" + __author_name__ = ("zapp-brannigan") + __author_mail__ = ("fuerst.reinje@web.de") + + FILE_INFO_PATTERN = r"""div id=\"file_name\" title=.+>(?P.+)\((?P.*) (?P[kKmMbB]|Bytes)\)<""" + RECAPTCHA_KEY = "6LdlJuwSAAAAAPJbPIoUhyqOJd7-yrah5Nhim5S3" + WAIT_PATTERN = r'data-time=\"(\d+)\" data-format' + FILE_ID = r'name=\"recaptcha_shortencode_field\" value=\"(.+)\"' + FILE_OFFLINE_PATTERN = r'

File not available

' + + def setup(self): + self.multiDL = False + self.chunkLimit = 1 + + def process(self, pyfile): + #Load website and set a cookie + self.html = self.load(pyfile.url, cookies=True, decode=True) + + # Set some vars + base_url = "http://www.uploadable.ch" + file_id = re.search(self.FILE_ID,self.html).group(1) + long_url = base_url+"/file/"+file_id+"/"+self.pyfile.name + not_so_long_url = base_url+"/file/"+file_id + self.logDebug("base_url: "+base_url) + self.logDebug("file_id: "+file_id) + self.logDebug("long_url: "+long_url) + self.logDebug("not_so_long_url: "+not_so_long_url) + + # Click the "free user" button and wait + post_data = { "downloadLink": "wait" } + a = self.load(not_so_long_url, cookies=True, post=post_data, decode=True) + self.logDebug(a) #Expected output: {"waitTime":30} + seconds = re.search(self.WAIT_PATTERN,self.html).group(1) + self.setWait(int(seconds) + 2) + self.wait() + + # Make the recaptcha appear and show it the pyload interface + post_data = { "checkDownload": "check" } + b = self.load(long_url, cookies=True, post=post_data, decode=True) + self.logDebug(b) #Expected output: {"success":"showCaptcha"} + recaptcha = ReCaptcha(self) + challenge, code = recaptcha.challenge(self.RECAPTCHA_KEY) + + # Submit the captcha solution + post_data = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": code, "recaptcha_shortencode_field": file_id} + c = self.load("http://www.uploadable.ch/checkReCaptcha.php", cookies=True, post=post_data, decode=True) + time.sleep(3) + + # Get ready for downloading + post_data = {"downloadLink": "show"} + self.download(not_so_long_url, cookies=True, post=post_data, disposition=True) + time.sleep(3) + + # Download the file + post_data = {"download": "normal"} + self.download(not_so_long_url, cookies=True, post=post_data, disposition=True) + + # Check the downloaded file + check = self.checkDownload({"wait_or_reconnect": re.compile("Please wait for"), "is_html": re.compile("")}) + if check == "wait_or_reconnect": + self.logInfo("Downloadlimit reached, please wait or reconnect") + self.setWait(60*60,True) + self.retry() + elif check == "is_html": + self.logInfo("The downloaded file is html, maybe you entered a wrong captcha") + self.retry() + +getInfo = create_getInfo(UploadableCh) + -- cgit v1.2.3 From b0d0a28d0e35a825c6dc465bcc5963d93b2e4ef4 Mon Sep 17 00:00:00 2001 From: zapp-brannigan Date: Sun, 27 Jul 2014 19:26:52 +0200 Subject: Update UploadableCh.py --- module/plugins/hoster/UploadableCh.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/UploadableCh.py b/module/plugins/hoster/UploadableCh.py index 9d44b17db..9e7396ee8 100644 --- a/module/plugins/hoster/UploadableCh.py +++ b/module/plugins/hoster/UploadableCh.py @@ -56,12 +56,12 @@ class UploadableCh(SimpleHoster): # Submit the captcha solution post_data = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": code, "recaptcha_shortencode_field": file_id} - c = self.load("http://www.uploadable.ch/checkReCaptcha.php", cookies=True, post=post_data, decode=True) + c = self.load(base_url+"/checkReCaptcha.php", cookies=True, post=post_data, decode=True) time.sleep(3) # Get ready for downloading post_data = {"downloadLink": "show"} - self.download(not_so_long_url, cookies=True, post=post_data, disposition=True) + self.load(not_so_long_url, cookies=True, post=post_data, disposition=True) time.sleep(3) # Download the file -- cgit v1.2.3 From 43cdacabfee1a1b917f651d0b72aeae6af0b7e3b Mon Sep 17 00:00:00 2001 From: zapp-brannigan Date: Sun, 27 Jul 2014 19:31:13 +0200 Subject: Update UploadableCh.py --- module/plugins/hoster/UploadableCh.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/UploadableCh.py b/module/plugins/hoster/UploadableCh.py index 9e7396ee8..421cda41e 100644 --- a/module/plugins/hoster/UploadableCh.py +++ b/module/plugins/hoster/UploadableCh.py @@ -56,7 +56,7 @@ class UploadableCh(SimpleHoster): # Submit the captcha solution post_data = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": code, "recaptcha_shortencode_field": file_id} - c = self.load(base_url+"/checkReCaptcha.php", cookies=True, post=post_data, decode=True) + self.load(base_url+"/checkReCaptcha.php", cookies=True, post=post_data, decode=True) time.sleep(3) # Get ready for downloading @@ -79,4 +79,3 @@ class UploadableCh(SimpleHoster): self.retry() getInfo = create_getInfo(UploadableCh) - -- cgit v1.2.3 From c7e11410952064fb5437c6c60c27f972ccde0aed Mon Sep 17 00:00:00 2001 From: zapp-brannigan Date: Mon, 28 Jul 2014 17:47:37 +0200 Subject: Update UploadableCh.py --- module/plugins/hoster/UploadableCh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/UploadableCh.py b/module/plugins/hoster/UploadableCh.py index 421cda41e..1dbf9af55 100644 --- a/module/plugins/hoster/UploadableCh.py +++ b/module/plugins/hoster/UploadableCh.py @@ -61,7 +61,7 @@ class UploadableCh(SimpleHoster): # Get ready for downloading post_data = {"downloadLink": "show"} - self.load(not_so_long_url, cookies=True, post=post_data, disposition=True) + self.load(not_so_long_url, cookies=True, post=post_data, decode=True) time.sleep(3) # Download the file -- cgit v1.2.3 From fd082ee5cdaddceb8d4977f4407838811af3a004 Mon Sep 17 00:00:00 2001 From: zapp-brannigan Date: Fri, 1 Aug 2014 18:34:14 +0200 Subject: Update UploadableCh.py --- module/plugins/hoster/UploadableCh.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/UploadableCh.py b/module/plugins/hoster/UploadableCh.py index 1dbf9af55..a091a5c1b 100644 --- a/module/plugins/hoster/UploadableCh.py +++ b/module/plugins/hoster/UploadableCh.py @@ -15,7 +15,7 @@ class UploadableCh(SimpleHoster): __author_name__ = ("zapp-brannigan") __author_mail__ = ("fuerst.reinje@web.de") - FILE_INFO_PATTERN = r"""div id=\"file_name\" title=.+>(?P.+)\((?P.*) (?P[kKmMbB]|Bytes)\)<""" + FILE_INFO_PATTERN = r"""div id=\"file_name\" title=.*>(?P.+)\((?P.*) (?P[kKmMgG]?i?[bB].*)\)<""" RECAPTCHA_KEY = "6LdlJuwSAAAAAPJbPIoUhyqOJd7-yrah5Nhim5S3" WAIT_PATTERN = r'data-time=\"(\d+)\" data-format' FILE_ID = r'name=\"recaptcha_shortencode_field\" value=\"(.+)\"' @@ -34,6 +34,7 @@ class UploadableCh(SimpleHoster): file_id = re.search(self.FILE_ID,self.html).group(1) long_url = base_url+"/file/"+file_id+"/"+self.pyfile.name not_so_long_url = base_url+"/file/"+file_id + self.logDebug("filename: "+pyfile.name) self.logDebug("base_url: "+base_url) self.logDebug("file_id: "+file_id) self.logDebug("long_url: "+long_url) @@ -73,6 +74,7 @@ class UploadableCh(SimpleHoster): if check == "wait_or_reconnect": self.logInfo("Downloadlimit reached, please wait or reconnect") self.setWait(60*60,True) + self.wait() self.retry() elif check == "is_html": self.logInfo("The downloaded file is html, maybe you entered a wrong captcha") -- cgit v1.2.3 From 6358c74165e54a86d28c1d0bde8fc1a7a13e9830 Mon Sep 17 00:00:00 2001 From: zapp-brannigan Date: Sat, 2 Aug 2014 12:33:05 +0200 Subject: [kingfiles.net] New hoster As requested in https://github.com/pyload/pyload/issues/510 --- module/plugins/hoster/KingfilesNet.py | 63 +++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 module/plugins/hoster/KingfilesNet.py (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py new file mode 100644 index 000000000..62ba6a225 --- /dev/null +++ b/module/plugins/hoster/KingfilesNet.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +# Testlink: http://www.kingfiles.net/zcegm9nkh2n1/test.dd + +import re +from module.plugins.internal.CaptchaService import SolveMedia +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + +class KingfilesNet(SimpleHoster): + __name__ = "KingfilesNet" + __type__ = "hoster" + __pattern__ = r'https?://(www\.)?kingfiles.net/.+' + __version__ = "0.01" + __description__ = """KingfilesNet hoster plugin (free-user)""" + __author_name__ = ("zapp-brannigan") + __author_mail__ = ("fuerst.reinje@web.de") + + FILE_NAME_PATTERN = r'.+)\">' + FILE_SIZE_PATTERN = r'>Size: (?P.+) (?P[kKmMgG]?i?[bB])<' + OFFLINE_PATTERN = r'No such file with this filename' + FILE_ID_PATTERN = r'' + RANDOM_PATTERN = r'type=\"hidden\" name=\"rand\" value=\"(.+)\">' + DOWNLOAD_URL_PATTERN = r'var download_url = \'(.+)\';' + SOLVEMEDIA_PATTERN = r'src=\"http://api.solvemedia.com/papi/challenge.script\?k=(.+)\">' + + def setup(self): + self.multiDL = False + self.chunkLimit = 1 + + def process(self,pyfile): + #Load main page and find file-id + a = self.load(pyfile.url, cookies=True, decode=True) + file_id = re.search(self.FILE_ID_PATTERN, a).group(1) + self.logDebug("file_id: "+file_id) + + #Click the free user button + post_data = { "op": "download1", "usr_login": "", "id": file_id, "fname": pyfile.name, "referer": "", "method_free": "+" } + b = self.load(pyfile.url, post=post_data, cookies=True, decode=True) + + #Do the captcha stuff + captcha_key = re.search(self.SOLVEMEDIA_PATTERN, b).group(1) + if not captcha_key: + self.fail("Can not find captcha_key, maybe the plugin is out of date") + self.logDebug("captcha_key: "+captcha_key) + rand = re.search(self.RANDOM_PATTERN, b).group(1) + if not rand: + self.fail("Can not find random string, maybe the plugin is out of date") + self.logDebug("random string: "+rand) + solvemedia = SolveMedia(self) + captcha_challenge, captcha_response = solvemedia.challenge(captcha_key) + + #Make the downloadlink appear and load the file + post_data = { "op": "download2", "id": file_id, "rand": rand, "referer": pyfile.url, "method_free": "+", "method_premium": "", "adcopy_response": captcha_response, "adcopy_challenge": captcha_challenge, "down_direct": "1" } + c = self.load(pyfile.url, post=post_data, cookies=True, decode=True) + dl_url = re.search(self.DOWNLOAD_URL_PATTERN, c).group(1) + if not dl_url: + self.fail("Can not find download-url, maybe the plugin is out of date") + self.logDebug("Downloadurl: "+dl_url) + self.download(dl_url, cookies=True, disposition=True) + check = self.checkDownload({"is_html": re.compile("")}) + if check == "is_html": + self.fail("The downloaded file is html, something went wrong. Maybe the plugin is out of date") + +getInfo = create_getInfo(KingfilesNet) -- cgit v1.2.3 From 4cb72cf52d8ba79ce178ee7b0e28c12a31d6b178 Mon Sep 17 00:00:00 2001 From: zapp-brannigan Date: Sat, 2 Aug 2014 12:38:07 +0200 Subject: Delete KingfilesNet.py --- module/plugins/hoster/KingfilesNet.py | 63 ----------------------------------- 1 file changed, 63 deletions(-) delete mode 100644 module/plugins/hoster/KingfilesNet.py (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py deleted file mode 100644 index 62ba6a225..000000000 --- a/module/plugins/hoster/KingfilesNet.py +++ /dev/null @@ -1,63 +0,0 @@ -# -*- coding: utf-8 -*- -# Testlink: http://www.kingfiles.net/zcegm9nkh2n1/test.dd - -import re -from module.plugins.internal.CaptchaService import SolveMedia -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - -class KingfilesNet(SimpleHoster): - __name__ = "KingfilesNet" - __type__ = "hoster" - __pattern__ = r'https?://(www\.)?kingfiles.net/.+' - __version__ = "0.01" - __description__ = """KingfilesNet hoster plugin (free-user)""" - __author_name__ = ("zapp-brannigan") - __author_mail__ = ("fuerst.reinje@web.de") - - FILE_NAME_PATTERN = r'.+)\">' - FILE_SIZE_PATTERN = r'>Size: (?P.+) (?P[kKmMgG]?i?[bB])<' - OFFLINE_PATTERN = r'No such file with this filename' - FILE_ID_PATTERN = r'' - RANDOM_PATTERN = r'type=\"hidden\" name=\"rand\" value=\"(.+)\">' - DOWNLOAD_URL_PATTERN = r'var download_url = \'(.+)\';' - SOLVEMEDIA_PATTERN = r'src=\"http://api.solvemedia.com/papi/challenge.script\?k=(.+)\">' - - def setup(self): - self.multiDL = False - self.chunkLimit = 1 - - def process(self,pyfile): - #Load main page and find file-id - a = self.load(pyfile.url, cookies=True, decode=True) - file_id = re.search(self.FILE_ID_PATTERN, a).group(1) - self.logDebug("file_id: "+file_id) - - #Click the free user button - post_data = { "op": "download1", "usr_login": "", "id": file_id, "fname": pyfile.name, "referer": "", "method_free": "+" } - b = self.load(pyfile.url, post=post_data, cookies=True, decode=True) - - #Do the captcha stuff - captcha_key = re.search(self.SOLVEMEDIA_PATTERN, b).group(1) - if not captcha_key: - self.fail("Can not find captcha_key, maybe the plugin is out of date") - self.logDebug("captcha_key: "+captcha_key) - rand = re.search(self.RANDOM_PATTERN, b).group(1) - if not rand: - self.fail("Can not find random string, maybe the plugin is out of date") - self.logDebug("random string: "+rand) - solvemedia = SolveMedia(self) - captcha_challenge, captcha_response = solvemedia.challenge(captcha_key) - - #Make the downloadlink appear and load the file - post_data = { "op": "download2", "id": file_id, "rand": rand, "referer": pyfile.url, "method_free": "+", "method_premium": "", "adcopy_response": captcha_response, "adcopy_challenge": captcha_challenge, "down_direct": "1" } - c = self.load(pyfile.url, post=post_data, cookies=True, decode=True) - dl_url = re.search(self.DOWNLOAD_URL_PATTERN, c).group(1) - if not dl_url: - self.fail("Can not find download-url, maybe the plugin is out of date") - self.logDebug("Downloadurl: "+dl_url) - self.download(dl_url, cookies=True, disposition=True) - check = self.checkDownload({"is_html": re.compile("")}) - if check == "is_html": - self.fail("The downloaded file is html, something went wrong. Maybe the plugin is out of date") - -getInfo = create_getInfo(KingfilesNet) -- cgit v1.2.3 From cb6eb80875965ba1ab743ab116a861c6c5739194 Mon Sep 17 00:00:00 2001 From: zapp-brannigan Date: Thu, 4 Sep 2014 08:14:52 +0200 Subject: Update UploadableCh.py --- module/plugins/hoster/UploadableCh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/UploadableCh.py b/module/plugins/hoster/UploadableCh.py index a091a5c1b..05ed0247f 100644 --- a/module/plugins/hoster/UploadableCh.py +++ b/module/plugins/hoster/UploadableCh.py @@ -70,7 +70,7 @@ class UploadableCh(SimpleHoster): self.download(not_so_long_url, cookies=True, post=post_data, disposition=True) # Check the downloaded file - check = self.checkDownload({"wait_or_reconnect": re.compile("Please wait for"), "is_html": re.compile("")}) + check = self.checkDownload({"wait_or_reconnect": re.compile("Please wait for"), "is_html": re.compile("")}) if check == "wait_or_reconnect": self.logInfo("Downloadlimit reached, please wait or reconnect") self.setWait(60*60,True) -- cgit v1.2.3