diff options
Diffstat (limited to 'module/plugins/crypter')
-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 |
3 files changed, 76 insertions, 2 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 |