From 0e1e9b6eefa84ad1617b61580b821bed44940a5a Mon Sep 17 00:00:00 2001 From: Nitzo Date: Sat, 30 Jul 2016 02:24:11 +0300 Subject: [New Creapter] MirrorcreatorCom (fix #2200) --- module/plugins/crypter/MirrorcreatorCom.py | 111 +++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 module/plugins/crypter/MirrorcreatorCom.py diff --git a/module/plugins/crypter/MirrorcreatorCom.py b/module/plugins/crypter/MirrorcreatorCom.py new file mode 100644 index 000000000..0e422281f --- /dev/null +++ b/module/plugins/crypter/MirrorcreatorCom.py @@ -0,0 +1,111 @@ +# -*- coding: utf-8 -*- + +import os +import re + +from module.plugins.internal.Crypter import Crypter +from module.plugins.internal.misc import replace_patterns + + +class MirrorcreatorCom(Crypter): + __name__ = "MirrorcreatorCom" + __type__ = "crypter" + __version__ = "0.01" + __status__ = "testing" + + __pattern__ = r'https?://(?:www\.)?(?:mirrorcreator\.com/(?:files/|download\.php\?uid=)|mir\.cr/)(?P\w{8})' + __config__ = [("activated" , "bool", "Activated" , True), + ("hosters_priority" , "str" , "Prefered hoster priority (bar-separated)", "" ), + ("ignored_hosters" , "str" , "Ignored hoster list (bar-separated)" , "" ), + ("grab_all" , "bool", "Grab all URLs (default only first match)", False)] + + __description__ = """Mirrorcreator.com decrypter plugin""" + __license__ = "GPLv3" + __authors__ = [("GammaC0de", "nitzo2001[AT]yahoo[DOT]com")] + + + URL_REPLACEMENTS = [(__pattern__ + '.*', r'https://www.mirrorcreator.com/download.php?uid=\g')] + + OFFLINE_PATTERN = r'>Unfortunately, the link you have clicked is not available|>Error - Link disabled or is invalid|>Links Unavailable as the File Belongs to Suspended Account\\. <|>Links Unavailable\\.<' + LINK_PATTERN = r'
(.+?)<' + + + def decrypt(self, pyfile): + pyfile.url = replace_patterns(pyfile.url, self.URL_REPLACEMENTS) + + hosters_priority = [_h for _h in self.config.get('hosters_priority').split('|') if _h] + ignored_hosters = [_h for _h in self.config.get('ignored_hosters').split('|') if _h] + + self.data = self.load(pyfile.url) + + m = re.search(self.OFFLINE_PATTERN, self.data) + if m: + self.offline() + + pack_name, pack_folder = self.get_package_info() + + m = re.search(r'"(/mstat\.php\?uid=%s.+?)"' % self.info['pattern']['ID'], self.data) + if m is None: + self.fail("mstat URL not found") + + self.data = self.load(self.fixurl(m.group(1))) + + hosters_data = {} + for _tr in re.findall(r'(.+?)', self.data, re.S): + m = re.search(r'Download links for ([^<]+) - Mirrorcreator', self.data) + if m: + pack_name = m.group(1) + + # We remove file extension from package name + while True: + pack_name, ext = os.path.splitext(pack_name) + if ext == "": + break + + return pack_name, pack_name + + else: # Fallback to defaults + return self.package.name, self.package.folder + + + -- cgit v1.2.3