# -*- coding: utf-8 -*- from module.plugins.Crypter import Crypter import re class NetfolderIn(Crypter): __name__ = "NetfolderIn" __type__ = "crypter" __pattern__ = r"http://(?:www\.)?netfolder.in/((?P\w+)/\w+|folder.php\?folder_id=(?P\w+))" __version__ = "0.3" __description__ = """NetFolder Crypter Plugin""" __author_name__ = ("RaNaN", "fragonib") __author_mail__ = ("RaNaN@pyload.org", "fragonib[AT]yahoo[DOT]es") def decrypt(self, pyfile): # Request package self.html = self.load(pyfile.url) # Check for password protection if self.isPasswordProtected(): self.html = self.submitPassword() if self.html is None: self.fail("Incorrect password, please set right password on Add package form and retry") # Get package name and folder (package_name, folder_name) = self.getPackageNameAndFolder() # Get package links package_links = self.getLinks() # Set package self.packages = [(package_name, package_links, folder_name)] def isPasswordProtected(self): if '' in html: self.log.debug("NetfolderIn: Incorrect password, please set right password on Edit package form and retry") return None return html def getPackageNameAndFolder(self): title_re = r'
Inhalt des Ordners (?P.+)</span></div>' m = re.search(title_re, self.html) if m is not None: name = folder = m.group('title') self.log.debug("NetfolderIn: Found name [%s] and folder [%s] in package info" % (name, folder)) return (name, folder) else: name = self.pyfile.package().name folder = self.pyfile.package().folder self.log.debug("NetfolderIn: Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder)) return (name, folder) def getLinks(self): links = re.findall('href="(http://(?:www\.)?netload\.in/(?:datei|index.php\?.*?file_id=)\w+)', self.html) links = [x[0] for x in links] self.log.debug("NetfolderIn: Package has %d links" % len(links)) return links