From 096e457a5a44e1ade87504147468fda045e07a88 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 29 Jan 2015 23:19:39 +0100 Subject: [ExtractArchive] Fix password recognition --- module/plugins/hooks/ExtractArchive.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/ExtractArchive.py') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index f2bc11ec2..8c5af1bb5 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -329,6 +329,8 @@ class ExtractArchive(Hook): pyfile.setCustomStatus(_("extracting")) pyfile.setProgress(0) + encrypted = False + try: try: archive.check() @@ -337,11 +339,12 @@ class ExtractArchive(Hook): self.logInfo(fname, _("Header protected")) if self.getConfig("repair"): - self.logWarning(fname, "Repairing...") + self.logWarning(fname, _("Repairing...")) archive.repair() except PasswordError): self.logInfo(fname, _("Password protected")) + encrypted = True except ArchiveError, e: if e != "Empty Archive" or not self.getConfig("extractempty"): @@ -349,7 +352,7 @@ class ExtractArchive(Hook): self.logDebug("Password: %s" % (password or "No provided")) - if not self.getConfig("usepasswordfile"): + if not encrypted or not self.getConfig("usepasswordfile"): archive.extract(password) else: for pw in set(self.getPasswords(False) + [password]): -- cgit v1.2.3