diff options
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/crypter/FileserveComFolder.py | 31 | ||||
-rw-r--r-- | module/plugins/crypter/FilesonicComFolder.py | 4 | ||||
-rw-r--r-- | module/plugins/crypter/MediafireComFolder.py | 43 | ||||
-rw-r--r-- | module/plugins/hoster/MediafireCom.py | 43 |
4 files changed, 105 insertions, 16 deletions
diff --git a/module/plugins/crypter/FileserveComFolder.py b/module/plugins/crypter/FileserveComFolder.py new file mode 100644 index 000000000..f9fd9f1cc --- /dev/null +++ b/module/plugins/crypter/FileserveComFolder.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +import re +from module.plugins.Crypter import Crypter + +class FileserveComFolder(Crypter): + __name__ = "FileserveComFolder" + __type__ = "crypter" + __pattern__ = r"http://(www\.)?fileserve\.com/list/\w+" + __version__ = "0.10" + __description__ = """Fileserve.com Folder Plugin""" + __author_name__ = ("zoidberg") + __author_mail__ = ("zoidberg@mujmail.cz") + + FOLDER_PATTERN = r'<div class="middle">(.*?)<div class="tail">' + LINK_PATTERN = r'<a href="(/file/[^"]+)"' + + def decrypt(self, pyfile): + html = self.load(pyfile.url) + + new_links = [] + + folder = re.search(self.FOLDER_PATTERN, html, re.DOTALL) + if not folder: self.fail("Parse error (FOLDER)") + + new_links.extend(map(lambda s:"http://www.fileserve.com%s" % s, re.findall(self.LINK_PATTERN, folder.group(1)))) + + if new_links: + self.core.files.addLinks(new_links, self.pyfile.package().id) + else: + self.fail('Could not extract any links')
\ No newline at end of file diff --git a/module/plugins/crypter/FilesonicComFolder.py b/module/plugins/crypter/FilesonicComFolder.py index 7bf1df381..b967a74a1 100644 --- a/module/plugins/crypter/FilesonicComFolder.py +++ b/module/plugins/crypter/FilesonicComFolder.py @@ -6,8 +6,8 @@ from module.plugins.Crypter import Crypter class FilesonicComFolder(Crypter): __name__ = "FilesonicComFolder" __type__ = "crypter" - __pattern__ = r"http://(\w*\.)?(sharingmatrix|filesonic|wupload)\.[^/]*/folder/\d+/?" - __version__ = "0.10" + __pattern__ = r"http://(\w*\.)?(sharingmatrix|filesonic|wupload)\.[^/]*/folder/\w+/?" + __version__ = "0.11" __description__ = """Filesonic.com/Wupload.com Folder Plugin""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") diff --git a/module/plugins/crypter/MediafireComFolder.py b/module/plugins/crypter/MediafireComFolder.py new file mode 100644 index 000000000..49a72ca76 --- /dev/null +++ b/module/plugins/crypter/MediafireComFolder.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- + +import re +from module.plugins.Crypter import Crypter +from module.common.json_layer import json_loads + +class MediafireComFolder(Crypter): + __name__ = "MediafireComFolder" + __type__ = "crypter" + __pattern__ = r"http://(\w*\.)*mediafire\.com/(folder/|\?).*" + __version__ = "0.10" + __description__ = """Mediafire.com Folder Plugin""" + __author_name__ = ("zoidberg") + __author_mail__ = ("zoidberg@mujmail.cz") + + FOLDER_KEY_PATTERN = r"var afI= '(\w+)';" + FILE_URL_PATTERN = '<meta property="og:url" content="http://www.mediafire.com/\?(\w+)"/>' + + def decrypt(self, pyfile): + new_links = [] + + html = self.load(pyfile.url) + found = re.search(self.FILE_URL_PATTERN, html) + if found: + new_links.append("http://www.mediafire.com/download.php?" + found.group(1)) + else: + found = re.search(self.FOLDER_KEY_PATTERN, html) + if not found: self.fail('Parse error: Folder Key') + folder_key = found.group(1) + self.logDebug("FOLDER KEY: %s" % folder_key) + + json_resp = json_loads(self.load("http://www.mediafire.com/api/folder/get_info.php?folder_key=%s&response_format=json&version=1" % folder_key)) + #self.logInfo(json_resp) + if json_resp['response']['result'] == "Success": + for link in json_resp['response']['folder_info']['files']: + new_links.append("http://www.mediafire.com/download.php?%s" % link['quickkey']) + else: + self.fail(json_resp['response']['message']) + + if new_links: + self.core.files.addLinks(new_links, self.pyfile.package().id) + else: + self.fail('Could not extract any links')
\ No newline at end of file diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py index e499a406f..2309dd94f 100644 --- a/module/plugins/hoster/MediafireCom.py +++ b/module/plugins/hoster/MediafireCom.py @@ -26,8 +26,8 @@ def replace_eval(js_expr): class MediafireCom(SimpleHoster): __name__ = "MediafireCom" __type__ = "hoster" - __pattern__ = r"http://(?:\w*\.)*mediafire\.com/.*" - __version__ = "0.64" + __pattern__ = r"http://(?:\w*\.)*mediafire\.com/download.php\?.*" + __version__ = "0.65" __description__ = """Mediafire.com plugin - free only""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") @@ -37,7 +37,7 @@ class MediafireCom(SimpleHoster): PAGE1_RESULT_PATTERN = r"(\w+)\('(?P<qk>[^']+)','(?P<pk1>[^']+)'\)" PAGE1_DIV_PATTERN = r'getElementById\("(\w{32})"\)' PAGE1_PKR_PATTERN = r"pKr='([^']+)';" - RECAPTCHA_PATTERN = r'src="http://api.recaptcha.net/challenge?k=([^"]+)">' + RECAPTCHA_PATTERN = r'src="http://(?:api.recaptcha.net|www.google.com/recaptcha/api)/challenge\?k=([^"]+)">' PAGE1_ACTION_PATTERN = r'<link rel="canonical" href="([^"]+)"/>' PAGE2_VARS_PATTERN = r'<script language="Javascript"><!--\s*(var.*?unescape.*?)eval\(' @@ -49,18 +49,16 @@ class MediafireCom(SimpleHoster): FILE_SIZE_PATTERN = r'<input type="hidden" id="sharedtabsfileinfo1-fs" value="([0-9.]+) ([kKMG]i?B)">' FILE_OFFLINE_PATTERN = r'class="error_msg_title"> Invalid or Deleted File. </div>' + def process(self, pyfile): + self.html = self.load(pyfile.url, decode = True) + self.checkCaptcha() + self.getFileInfo() + if self.account: + self.handlePremium() + else: + self.handleFree() + def handleFree(self): - found = re.search(self.RECAPTCHA_PATTERN, self.html) - if found: - captcha_action = re.search(self.PAGE1_ACTION_PATTERN, self.html).group(1) - captcha_key = found.group(1) - recaptcha = ReCaptcha(self) - captcha_challenge, captcha_response = recaptcha.challenge(captcha_key) - self.html = self.load(captcha_action, post = { - "recaptcha_challenge_field": captcha_challenge, - "recaptcha_response_field": captcha_response - }) - found = re.search(self.PAGE1_KEY_PATTERN, self.html) if found: result = self.js.eval(found.group(1)) @@ -116,6 +114,23 @@ class MediafireCom(SimpleHoster): self.logDebug("FINAL LINK: %s" % final_link) self.download(final_link) + + def checkCaptcha(self): + for i in range(5): + found = re.search(self.RECAPTCHA_PATTERN, self.html) + if found: + captcha_action = re.search(self.PAGE1_ACTION_PATTERN, self.html).group(1) + captcha_key = found.group(1) + recaptcha = ReCaptcha(self) + captcha_challenge, captcha_response = recaptcha.challenge(captcha_key) + self.html = self.load(captcha_action, post = { + "recaptcha_challenge_field": captcha_challenge, + "recaptcha_response_field": captcha_response + }) + else: + break + else: + self.fail("No valid recaptcha solution received") getInfo = create_getInfo(MediafireCom)
\ No newline at end of file |