diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-10-15 11:38:37 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-10-15 11:38:37 +0200 |
commit | e821199dadb92ac05160ceeaa10e2773bf34f07e (patch) | |
tree | abc55972293bca3fd83d79e7f5bb845e28cc20ff /module/plugins | |
parent | simple unzip plugin (diff) | |
download | pyload-e821199dadb92ac05160ceeaa10e2773bf34f07e.tar.xz |
fixes for unrar
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/hooks/ExtractArchive.py | 2 | ||||
-rw-r--r-- | module/plugins/internal/UnRar.py | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 0489d1a0a..aee8674ec 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -202,7 +202,7 @@ class ExtractArchive(Hook): except Exception, e: if self.core.debug: print_exc() - self.logError(basename(plugin.file), _("Unkown Error"), str(e)) + self.logError(basename(plugin.file), _("Unknown Error"), str(e)) return [] diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py index a1bfef42f..9aff4bb8e 100644 --- a/module/plugins/internal/UnRar.py +++ b/module/plugins/internal/UnRar.py @@ -34,8 +34,7 @@ class UnRar(AbtractExtractor): # there are some more uncovered rar formats re_splitfile = re.compile(r"(.*)\.part(\d+)\.rar$") re_filelist = re.compile(r"(.+)\s+(\d+)\s+(\d+)\s+") - - WRONG_PWD = "Corrupt file or wrong password." + re_wrongpwd = re.compile("(Corrupt file or wrong password|password incorrect)") @staticmethod def checkDeps(): @@ -75,7 +74,7 @@ class UnRar(AbtractExtractor): def checkArchive(self): p = self.call_unrar("l", "-v", self.file) out, err = p.communicate() - if self.WRONG_PWD in err: + if self.re_wrongpwd.search(err): self.passwordProtected = True self.headerProtected = True return True @@ -97,7 +96,7 @@ class UnRar(AbtractExtractor): if self.headerProtected: p = self.call_unrar("l", "-v", self.file, password=password) out, err = p.communicate() - if self.WRONG_PWD in err: + if self.re_wrongpwd.search(err): return False return True @@ -119,6 +118,8 @@ class UnRar(AbtractExtractor): self.m.crcError() elif "CRC failed" in err: self.m.wrongPassword() + if err.strip(): #raise error if anything is on stderr + self.m.archiveError(err.strip()) if not self.files: self.password = password @@ -138,6 +139,9 @@ class UnRar(AbtractExtractor): if "Cannot open" in err: self.m.archiveError("Cannot open file") + if err.strip(): # only log error at this point + self.m.logError(err.strip()) + result = set() for f in decode(out).splitlines(): |