summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/KingfilesNet.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/KingfilesNet.py')
-rw-r--r--module/plugins/hoster/KingfilesNet.py22
1 files changed, 7 insertions, 15 deletions
diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py
index 4d87a5933..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<ID>\w{12})'
__description__ = """Kingfiles.net hoster plugin"""
__author_name__ = ("zapp-brannigan", "Walter Purcaro")
@@ -23,11 +23,9 @@ class KingfilesNet(SimpleHoster):
OFFLINE_PATTERN = r'>(File Not Found</b><br><br>|File Not Found</h2>)'
- FILE_ID_PATTERN = r'<input type=\"hidden\" name=\"id\" 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=(.+)\">'
def setup(self):
@@ -36,27 +34,21 @@ 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': "+"}
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)