From d00e9f3e3b825a0324335860b32cd46dbea0b087 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Sep 2014 18:03:43 +0200 Subject: New hoster KingfilesNet --- module/plugins/hoster/KingfilesNet.py | 93 +++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 module/plugins/hoster/KingfilesNet.py (limited to 'module/plugins/hoster/KingfilesNet.py') diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py new file mode 100644 index 000000000..1a9e9e81d --- /dev/null +++ b/module/plugins/hoster/KingfilesNet.py @@ -0,0 +1,93 @@ +# -*- coding: utf-8 -*- + +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" + __version__ = "0.01" + + __pattern__ = r'http://(?:www\.)?kingfiles\.net/\w{12}' + + __description__ = """Kingfiles.net hoster plugin""" + __author_name__ = ("zapp-brannigan", "Walter Purcaro") + __author_mail__ = ("fuerst.reinje@web.de", "vuolter@gmail.com") + + + FILE_NAME_PATTERN = r'name="fname" value="(?P.+?)">' + FILE_SIZE_PATTERN = r'>Size: .+?">(?P[\d.]+) (?P\w+)' + + OFFLINE_PATTERN = r'>(File Not Found

|File Not Found)' + + FILE_ID_PATTERN = r'' + RANDOM_PATTERN = r'type=\"hidden\" name=\"rand\" value=\"(.+)\">' + + LINK_PATTERN = r'var download_url = \'(.+)\';' + SOLVEMEDIA_PATTERN = r'http://api.solvemedia.com/papi/challenge.script\?k=(.+)\">' + + + def setup(self): + self.multiDL = True + self.resumeDownload = True + + + def handleFree(self): + # Load main page and find file-id + a = self.load(self.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': self.pyfile.name, + 'referer': "", + 'method_free': "+"} + b = self.load(self.pyfile.url, post=post_data, cookies=True, decode=True) + + # Do the captcha stuff + m = re.search(self.SOLVEMEDIA_PATTERN, b) + if m is None: + self.parseError("Captcha key not found") + + solvemedia = SolveMedia(self) + captcha_key = m.group(1) + self.logDebug("captcha_key", captcha_key) + captcha_challenge, captcha_response = solvemedia.challenge(captcha_key) + + # Make the downloadlink appear and load the file + m = re.search(self.RANDOM_PATTERN, b) + if m is None: + self.parseError("Random key not found") + + rand = m.group(1) + self.logDebug("rand", rand) + + post_data = {'op': "download2", + 'id': file_id, + 'rand': rand, + 'referer': self.pyfile.url, + 'method_free': "+", + 'method_premium': "", + 'adcopy_response': captcha_response, + 'adcopy_challenge': captcha_challenge, + 'down_direct': "1"} + c = self.load(self.pyfile.url, post=post_data, cookies=True, decode=True) + + m = re.search(self.LINK_PATTERN, c) + if m is None: + self.parseError("Download url not found") + + dl_url = m.group(1) + self.download(dl_url, cookies=True, disposition=True) + + if self.checkDownload({'is_html': re.compile("")}) == "is_html": + self.fail("The downloaded file is html, something went wrong.") + + +getInfo = create_getInfo(KingfilesNet) -- cgit v1.2.3 From 2bdb05b165f2ebc2fd416165aa15691fa7ebe088 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Sep 2014 18:09:35 +0200 Subject: [KingfilesNet] Better SOLVEMEDIA_PATTERN --- module/plugins/hoster/KingfilesNet.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/KingfilesNet.py') diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index 1a9e9e81d..f0e51645a 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -24,10 +24,10 @@ class KingfilesNet(SimpleHoster): OFFLINE_PATTERN = r'>(File Not Found

|File Not Found)' FILE_ID_PATTERN = r'' - RANDOM_PATTERN = r'type=\"hidden\" name=\"rand\" value=\"(.+)\">' + RAND_ID_PATTERN = r'type=\"hidden\" name=\"rand\" value=\"(.+)\">' LINK_PATTERN = r'var download_url = \'(.+)\';' - SOLVEMEDIA_PATTERN = r'http://api.solvemedia.com/papi/challenge.script\?k=(.+)\">' + SOLVEMEDIA_PATTERN = r'http://api\.solvemedia\.com/papi/challenge\.script\?k=(.+)\">' def setup(self): @@ -61,7 +61,7 @@ class KingfilesNet(SimpleHoster): captcha_challenge, captcha_response = solvemedia.challenge(captcha_key) # Make the downloadlink appear and load the file - m = re.search(self.RANDOM_PATTERN, b) + m = re.search(self.RAND_ID_PATTERN, b) if m is None: self.parseError("Random key not found") -- cgit v1.2.3 From 59f743bbfde24d94a16c9fc60095014d66a2cb70 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 28 Sep 2014 19:14:58 +0200 Subject: [SpeedyshareCom] Code cleanup --- module/plugins/hoster/KingfilesNet.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/KingfilesNet.py') diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index f0e51645a..4d87a5933 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -86,8 +86,9 @@ class KingfilesNet(SimpleHoster): dl_url = m.group(1) self.download(dl_url, cookies=True, disposition=True) - if self.checkDownload({'is_html': re.compile("")}) == "is_html": - self.fail("The downloaded file is html, something went wrong.") + check = self.checkDownload({'is_html': re.compile("")}) + if check == "is_html": + self.parseError("Downloaded file is an html file") getInfo = create_getInfo(KingfilesNet) -- cgit v1.2.3 From 23ae563604dca1dae262fbc598154b99b2f1eae8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 3 Oct 2014 09:06:05 +0200 Subject: Update plugins after CaptchaService and XFileSharingPro changes --- module/plugins/hoster/KingfilesNet.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'module/plugins/hoster/KingfilesNet.py') diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index 4d87a5933..66a639a14 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -27,7 +27,6 @@ class KingfilesNet(SimpleHoster): RAND_ID_PATTERN = r'type=\"hidden\" name=\"rand\" value=\"(.+)\">' LINK_PATTERN = r'var download_url = \'(.+)\';' - SOLVEMEDIA_PATTERN = r'http://api\.solvemedia\.com/papi/challenge\.script\?k=(.+)\">' def setup(self): @@ -50,13 +49,12 @@ class KingfilesNet(SimpleHoster): 'method_free': "+"} b = self.load(self.pyfile.url, post=post_data, cookies=True, decode=True) - # Do the captcha stuff - m = re.search(self.SOLVEMEDIA_PATTERN, b) - if m is None: - self.parseError("Captcha key not found") - solvemedia = SolveMedia(self) - captcha_key = m.group(1) + + captcha_key = solvemedia.detect_key() + if captcha_key is None: + self.parseError("SolveMedia key not found") + self.logDebug("captcha_key", captcha_key) captcha_challenge, captcha_response = solvemedia.challenge(captcha_key) -- cgit v1.2.3 From 0d4b92d58e6d4e959aeaa780cf29b8d88f46610a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 3 Oct 2014 14:00:46 +0200 Subject: Spare code cosmetics --- module/plugins/hoster/KingfilesNet.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'module/plugins/hoster/KingfilesNet.py') diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index 66a639a14..e8aefa53b 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -11,7 +11,7 @@ class KingfilesNet(SimpleHoster): __type__ = "hoster" __version__ = "0.01" - __pattern__ = r'http://(?:www\.)?kingfiles\.net/\w{12}' + __pattern__ = r'http://(?:www\.)?kingfiles\.net/(?P\w{12})' __description__ = """Kingfiles.net hoster plugin""" __author_name__ = ("zapp-brannigan", "Walter Purcaro") @@ -23,7 +23,6 @@ class KingfilesNet(SimpleHoster): OFFLINE_PATTERN = r'>(File Not Found

|File Not Found)' - FILE_ID_PATTERN = r'' RAND_ID_PATTERN = r'type=\"hidden\" name=\"rand\" value=\"(.+)\">' LINK_PATTERN = r'var download_url = \'(.+)\';' @@ -35,15 +34,10 @@ class KingfilesNet(SimpleHoster): def handleFree(self): - # Load main page and find file-id - a = self.load(self.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, + 'id': file_info['ID'], 'fname': self.pyfile.name, 'referer': "", 'method_free': "+"} -- cgit v1.2.3 From ff91b58bf9ee65aaeb048426295af6ad122b119e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 5 Oct 2014 22:14:53 +0200 Subject: Spare code cosmetics --- module/plugins/hoster/KingfilesNet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/KingfilesNet.py') diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index e8aefa53b..208946805 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -78,8 +78,8 @@ class KingfilesNet(SimpleHoster): dl_url = m.group(1) self.download(dl_url, cookies=True, disposition=True) - check = self.checkDownload({'is_html': re.compile("")}) - if check == "is_html": + check = self.checkDownload({'html': re.compile("")}) + if check == "html": self.parseError("Downloaded file is an html file") -- cgit v1.2.3 From b0868ae6446078bacf1635dde5e4ab316b4a94cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Oct 2014 18:57:59 +0200 Subject: New __authors__ key replaces __author_name__ and __author_mail__ + Whitespaces and EOF fixup --- module/plugins/hoster/KingfilesNet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/KingfilesNet.py') diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index 208946805..82bbd735f 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -14,8 +14,8 @@ class KingfilesNet(SimpleHoster): __pattern__ = r'http://(?:www\.)?kingfiles\.net/(?P\w{12})' __description__ = """Kingfiles.net hoster plugin""" - __author_name__ = ("zapp-brannigan", "Walter Purcaro") - __author_mail__ = ("fuerst.reinje@web.de", "vuolter@gmail.com") + __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de"), + ("Walter Purcaro", "vuolter@gmail.com")] FILE_NAME_PATTERN = r'name="fname" value="(?P.+?)">' -- cgit v1.2.3 From ae7a7e66981456e5bbe2b54006d79b6f907be7a4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- module/plugins/hoster/KingfilesNet.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/KingfilesNet.py') diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index 82bbd735f..bf2cb2ace 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -14,6 +14,7 @@ class KingfilesNet(SimpleHoster): __pattern__ = r'http://(?:www\.)?kingfiles\.net/(?P\w{12})' __description__ = """Kingfiles.net hoster plugin""" + __license__ = "GPLv3" __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de"), ("Walter Purcaro", "vuolter@gmail.com")] -- cgit v1.2.3 From c5d1a4fd8943877c6d2eb3843e0de725dba5191e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:09:53 +0200 Subject: Pattern update 2 --- module/plugins/hoster/KingfilesNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/KingfilesNet.py') diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index bf2cb2ace..8eaf54e12 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -20,7 +20,7 @@ class KingfilesNet(SimpleHoster): FILE_NAME_PATTERN = r'name="fname" value="(?P.+?)">' - FILE_SIZE_PATTERN = r'>Size: .+?">(?P[\d.]+) (?P\w+)' + FILE_SIZE_PATTERN = r'>Size: .+?">(?P[\d.,]+) (?P\w+)' OFFLINE_PATTERN = r'>(File Not Found

|File Not Found)' -- cgit v1.2.3 From 388a2f6478d42e423f1f8442d8539983f3762f22 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 14 Oct 2014 13:38:49 +0200 Subject: Improve unit detection in size pattern --- module/plugins/hoster/KingfilesNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/KingfilesNet.py') diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index 8eaf54e12..e4e664c14 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -20,7 +20,7 @@ class KingfilesNet(SimpleHoster): FILE_NAME_PATTERN = r'name="fname" value="(?P.+?)">' - FILE_SIZE_PATTERN = r'>Size: .+?">(?P[\d.,]+) (?P\w+)' + FILE_SIZE_PATTERN = r'>Size: .+?">(?P[\d.,]+) (?P[\w^_]+)' OFFLINE_PATTERN = r'>(File Not Found

|File Not Found)' -- cgit v1.2.3 From 2ae91b81a2f12a1c9b1f78524df78a2b3f1ef494 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Oct 2014 14:52:42 +0200 Subject: Update hosters to self.error --- module/plugins/hoster/KingfilesNet.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/KingfilesNet.py') diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index e4e664c14..c6dbd1e5c 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class KingfilesNet(SimpleHoster): __name__ = "KingfilesNet" __type__ = "hoster" - __version__ = "0.01" + __version__ = "0.02" __pattern__ = r'http://(?:www\.)?kingfiles\.net/(?P\w{12})' @@ -48,7 +48,7 @@ class KingfilesNet(SimpleHoster): captcha_key = solvemedia.detect_key() if captcha_key is None: - self.parseError("SolveMedia key not found") + self.error("SolveMedia key not found") self.logDebug("captcha_key", captcha_key) captcha_challenge, captcha_response = solvemedia.challenge(captcha_key) @@ -56,7 +56,7 @@ class KingfilesNet(SimpleHoster): # Make the downloadlink appear and load the file m = re.search(self.RAND_ID_PATTERN, b) if m is None: - self.parseError("Random key not found") + self.error("Random key not found") rand = m.group(1) self.logDebug("rand", rand) @@ -74,14 +74,14 @@ class KingfilesNet(SimpleHoster): m = re.search(self.LINK_PATTERN, c) if m is None: - self.parseError("Download url not found") + self.error("Download url not found") dl_url = m.group(1) self.download(dl_url, cookies=True, disposition=True) check = self.checkDownload({'html': re.compile("")}) if check == "html": - self.parseError("Downloaded file is an html file") + self.error("Downloaded file is an html file") getInfo = create_getInfo(KingfilesNet) -- cgit v1.2.3 From f00dbe52cee93a0aad9b6747419ff7271adb6e84 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 22 Oct 2014 10:12:21 +0200 Subject: Code cosmetics --- module/plugins/hoster/KingfilesNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/KingfilesNet.py') diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index c6dbd1e5c..7211aa378 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -81,7 +81,7 @@ class KingfilesNet(SimpleHoster): check = self.checkDownload({'html': re.compile("")}) if check == "html": - self.error("Downloaded file is an html file") + self.error("Downloaded file is an html page") getInfo = create_getInfo(KingfilesNet) -- cgit v1.2.3 From 7b67f68c1636014fe02286da71bdc6c13dc3eeee Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 23 Oct 2014 00:50:23 +0200 Subject: Simplify captcha challenge calls --- module/plugins/hoster/KingfilesNet.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'module/plugins/hoster/KingfilesNet.py') diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index 7211aa378..223241f5a 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -45,13 +45,7 @@ class KingfilesNet(SimpleHoster): b = self.load(self.pyfile.url, post=post_data, cookies=True, decode=True) solvemedia = SolveMedia(self) - - captcha_key = solvemedia.detect_key() - if captcha_key is None: - self.error("SolveMedia key not found") - - self.logDebug("captcha_key", captcha_key) - captcha_challenge, captcha_response = solvemedia.challenge(captcha_key) + captcha_challenge, captcha_response = solvemedia.challenge() # Make the downloadlink appear and load the file m = re.search(self.RAND_ID_PATTERN, b) -- cgit v1.2.3 From 4da90891eb2544ac15a7d512aba8cb357f68ee5f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Oct 2014 01:11:29 +0200 Subject: Spare code cosmetics --- module/plugins/hoster/KingfilesNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/KingfilesNet.py') diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index 223241f5a..b4e393c37 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -53,7 +53,7 @@ class KingfilesNet(SimpleHoster): self.error("Random key not found") rand = m.group(1) - self.logDebug("rand", rand) + self.logDebug("rand = ", rand) post_data = {'op': "download2", 'id': file_id, -- cgit v1.2.3 From 9f2ebe486a3e155fb6a60e07cccb77ab6a772eb2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 26 Oct 2014 02:31:54 +0200 Subject: Extend translation support in plugins + a lot of code cosmetics and typo fixes --- module/plugins/hoster/KingfilesNet.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/KingfilesNet.py') diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index b4e393c37..4bf477663 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -50,7 +50,7 @@ class KingfilesNet(SimpleHoster): # Make the downloadlink appear and load the file m = re.search(self.RAND_ID_PATTERN, b) if m is None: - self.error("Random key not found") + self.error(_("Random key not found")) rand = m.group(1) self.logDebug("rand = ", rand) @@ -68,14 +68,14 @@ class KingfilesNet(SimpleHoster): m = re.search(self.LINK_PATTERN, c) if m is None: - self.error("Download url not found") + self.error(_("Download url not found")) dl_url = m.group(1) self.download(dl_url, cookies=True, disposition=True) check = self.checkDownload({'html': re.compile("")}) if check == "html": - self.error("Downloaded file is an html page") + self.error(_("Downloaded file is an html page")) getInfo = create_getInfo(KingfilesNet) -- cgit v1.2.3 From 34984dae733c3f3d47b41a0acfba3724d53c65a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:52:10 +0100 Subject: Code cosmetics: plugin class attributes --- module/plugins/hoster/KingfilesNet.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/KingfilesNet.py') diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index 4bf477663..d369f7264 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -7,16 +7,16 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class KingfilesNet(SimpleHoster): - __name__ = "KingfilesNet" - __type__ = "hoster" + __name__ = "KingfilesNet" + __type__ = "hoster" __version__ = "0.02" __pattern__ = r'http://(?:www\.)?kingfiles\.net/(?P\w{12})' __description__ = """Kingfiles.net hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de"), - ("Walter Purcaro", "vuolter@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de"), + ("Walter Purcaro", "vuolter@gmail.com")] FILE_NAME_PATTERN = r'name="fname" value="(?P.+?)">' -- cgit v1.2.3 From 772e47ef806d18fd209e910be0535bce7c07dc7b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 2 Nov 2014 22:47:07 +0100 Subject: Update all other plugins --- module/plugins/hoster/KingfilesNet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/KingfilesNet.py') diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index d369f7264..2ca506cf7 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -19,8 +19,8 @@ class KingfilesNet(SimpleHoster): ("Walter Purcaro", "vuolter@gmail.com")] - FILE_NAME_PATTERN = r'name="fname" value="(?P.+?)">' - FILE_SIZE_PATTERN = r'>Size: .+?">(?P[\d.,]+) (?P[\w^_]+)' + NAME_PATTERN = r'name="fname" value="(?P.+?)">' + SIZE_PATTERN = r'>Size: .+?">(?P[\d.,]+) (?P[\w^_]+)' OFFLINE_PATTERN = r'>(File Not Found

|File Not Found)' -- cgit v1.2.3 From 03f3b86f500c495932fd118b54569d92f700847c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 3 Nov 2014 16:57:55 +0100 Subject: Code cosmetics about file_info and other stuff --- module/plugins/hoster/KingfilesNet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/KingfilesNet.py') diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index 2ca506cf7..3ccd5c172 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class KingfilesNet(SimpleHoster): __name__ = "KingfilesNet" __type__ = "hoster" - __version__ = "0.02" + __version__ = "0.03" __pattern__ = r'http://(?:www\.)?kingfiles\.net/(?P\w{12})' @@ -38,7 +38,7 @@ class KingfilesNet(SimpleHoster): # Click the free user button post_data = {'op': "download1", 'usr_login': "", - 'id': file_info['ID'], + 'id': self.info['ID'], 'fname': self.pyfile.name, 'referer': "", 'method_free': "+"} -- cgit v1.2.3 From 11ef847d475a3a55812e69373345e26edbe8b142 Mon Sep 17 00:00:00 2001 From: Bahram Maleki-Fard Date: Tue, 4 Nov 2014 23:48:19 +0100 Subject: [KingfilesNet] fix download for free user Need to update self.html when "clicking free-user button", otherwise CaptchaService works on previous html page and cannot find a captcha key. --- module/plugins/hoster/KingfilesNet.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'module/plugins/hoster/KingfilesNet.py') diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index 3ccd5c172..ce34da38f 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class KingfilesNet(SimpleHoster): __name__ = "KingfilesNet" __type__ = "hoster" - __version__ = "0.03" + __version__ = "0.04" __pattern__ = r'http://(?:www\.)?kingfiles\.net/(?P\w{12})' @@ -42,13 +42,14 @@ class KingfilesNet(SimpleHoster): 'fname': self.pyfile.name, 'referer': "", 'method_free': "+"} - b = self.load(self.pyfile.url, post=post_data, cookies=True, decode=True) + + self.html = self.load(self.pyfile.url, post=post_data, cookies=True, decode=True) solvemedia = SolveMedia(self) captcha_challenge, captcha_response = solvemedia.challenge() # Make the downloadlink appear and load the file - m = re.search(self.RAND_ID_PATTERN, b) + m = re.search(self.RAND_ID_PATTERN, self.html) if m is None: self.error(_("Random key not found")) @@ -56,7 +57,7 @@ class KingfilesNet(SimpleHoster): self.logDebug("rand = ", rand) post_data = {'op': "download2", - 'id': file_id, + 'id': self.info['ID'], 'rand': rand, 'referer': self.pyfile.url, 'method_free': "+", @@ -64,14 +65,14 @@ class KingfilesNet(SimpleHoster): 'adcopy_response': captcha_response, 'adcopy_challenge': captcha_challenge, 'down_direct': "1"} - c = self.load(self.pyfile.url, post=post_data, cookies=True, decode=True) - m = re.search(self.LINK_PATTERN, c) + self.html = self.load(self.pyfile.url, post=post_data, cookies=True, decode=True) + + m = re.search(self.LINK_PATTERN, self.html) if m is None: self.error(_("Download url not found")) - dl_url = m.group(1) - self.download(dl_url, cookies=True, disposition=True) + self.download(m.group(1), cookies=True, disposition=True) check = self.checkDownload({'html': re.compile("")}) if check == "html": -- cgit v1.2.3 From 86d3b6249073947132ed3a9eeb1b1e987d19569a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 1 Dec 2014 18:17:13 +0100 Subject: Update some plugins --- module/plugins/hoster/KingfilesNet.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/KingfilesNet.py') diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index ce34da38f..202ab4a77 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class KingfilesNet(SimpleHoster): __name__ = "KingfilesNet" __type__ = "hoster" - __version__ = "0.04" + __version__ = "0.05" __pattern__ = r'http://(?:www\.)?kingfiles\.net/(?P\w{12})' @@ -38,7 +38,7 @@ class KingfilesNet(SimpleHoster): # Click the free user button post_data = {'op': "download1", 'usr_login': "", - 'id': self.info['ID'], + 'id': self.info['pattern']['ID'], 'fname': self.pyfile.name, 'referer': "", 'method_free': "+"} @@ -57,7 +57,7 @@ class KingfilesNet(SimpleHoster): self.logDebug("rand = ", rand) post_data = {'op': "download2", - 'id': self.info['ID'], + 'id': self.info['pattern']['ID'], 'rand': rand, 'referer': self.pyfile.url, 'method_free': "+", -- cgit v1.2.3 From 67587fbe0335cacfde28a86ba729b9d567ce1da7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 7 Dec 2014 00:27:18 +0100 Subject: Plugin code cosmetics (3) --- module/plugins/hoster/KingfilesNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/KingfilesNet.py') diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index 202ab4a77..c84e3bb0f 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -30,8 +30,8 @@ class KingfilesNet(SimpleHoster): def setup(self): - self.multiDL = True self.resumeDownload = True + self.multiDL = True def handleFree(self): -- cgit v1.2.3 From 4d578cb15f3d6edd036e438e504739b97660f93e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 9 Dec 2014 16:58:35 +0100 Subject: Spare code cosmetics --- module/plugins/hoster/KingfilesNet.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'module/plugins/hoster/KingfilesNet.py') diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index c84e3bb0f..13cbf4781 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -36,17 +36,17 @@ class KingfilesNet(SimpleHoster): def handleFree(self): # Click the free user button - post_data = {'op': "download1", - 'usr_login': "", - 'id': self.info['pattern']['ID'], - 'fname': self.pyfile.name, - 'referer': "", + post_data = {'op' : "download1", + 'usr_login' : "", + 'id' : self.info['pattern']['ID'], + 'fname' : self.pyfile.name, + 'referer' : "", 'method_free': "+"} self.html = self.load(self.pyfile.url, post=post_data, cookies=True, decode=True) solvemedia = SolveMedia(self) - captcha_challenge, captcha_response = solvemedia.challenge() + challenge, response = solvemedia.challenge() # Make the downloadlink appear and load the file m = re.search(self.RAND_ID_PATTERN, self.html) @@ -56,15 +56,15 @@ class KingfilesNet(SimpleHoster): rand = m.group(1) self.logDebug("rand = ", rand) - post_data = {'op': "download2", - 'id': self.info['pattern']['ID'], - 'rand': rand, - 'referer': self.pyfile.url, - 'method_free': "+", - 'method_premium': "", - 'adcopy_response': captcha_response, - 'adcopy_challenge': captcha_challenge, - 'down_direct': "1"} + post_data = {'op' : "download2", + 'id' : self.info['pattern']['ID'], + 'rand' : rand, + 'referer' : self.pyfile.url, + 'method_free' : "+", + 'method_premium' : "", + 'adcopy_response' : response, + 'adcopy_challenge': challenge, + 'down_direct' : "1"} self.html = self.load(self.pyfile.url, post=post_data, cookies=True, decode=True) -- cgit v1.2.3