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