From ae15749449563f5adaabd250ea62460c18af6498 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 3 Nov 2014 12:16:40 +0100 Subject: Update crypters --- module/plugins/crypter/DataHuFolder.py | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'module/plugins/crypter/DataHuFolder.py') diff --git a/module/plugins/crypter/DataHuFolder.py b/module/plugins/crypter/DataHuFolder.py index 39523c05d..0399e686d 100644 --- a/module/plugins/crypter/DataHuFolder.py +++ b/module/plugins/crypter/DataHuFolder.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class DataHuFolder(SimpleCrypter): __name__ = "DataHuFolder" __type__ = "crypter" - __version__ = "0.05" + __version__ = "0.06" __pattern__ = r'http://(?:www\.)?data\.hu/dir/\w+' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), @@ -21,25 +21,20 @@ class DataHuFolder(SimpleCrypter): LINK_PATTERN = r'\1' - NAME_PATTERN = ur'(.+) Let\xf6lt\xe9se' + NAME_PATTERN = ur'(?P<N>.+) Let\xf6lt\xe9se' - def decrypt(self, pyfile): - self.html = self.load(pyfile.url, decode=True) + def prepare(self): + super(DataHuFolder, self).prepare() if u'K\xe9rlek add meg a jelsz\xf3t' in self.html: # Password protected password = self.getPassword() - if password is '': - self.fail(_("No password specified, please set right password on Add package form and retry")) - self.logDebug("The folder is password protected', 'Using password: " + password) - self.html = self.load(pyfile.url, post={'mappa_pass': password}, decode=True) - if u'Hib\xe1s jelsz\xf3' in self.html: # Wrong password - self.fail(_("Incorrect password, please set right password on Add package form and retry")) + if not password: + self.fail(_("Password required")) - package_name, folder_name = self.getPackageNameAndFolder() + self.logDebug("The folder is password protected', 'Using password: " + password) - package_links = re.findall(self.LINK_PATTERN, self.html) - self.logDebug("Package has %d links" % len(package_links)) + self.html = self.load(self.pyfile.url, post={'mappa_pass': password}, decode=True) - if package_links: - self.packages = [(package_name, package_links, folder_name)] + if u'Hib\xe1s jelsz\xf3' in self.html: # Wrong password + self.fail(_("Wrong password")) -- cgit v1.2.3