# -*- 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