diff options
Diffstat (limited to 'module/plugins/internal/UnZip.py')
-rw-r--r-- | module/plugins/internal/UnZip.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/module/plugins/internal/UnZip.py b/module/plugins/internal/UnZip.py index 83ed3a233..2ab9597ef 100644 --- a/module/plugins/internal/UnZip.py +++ b/module/plugins/internal/UnZip.py @@ -27,20 +27,18 @@ class UnZip(Extractor): return sys.version_info[:2] >= (2, 6) - @classmethod - def getTargets(cls, files_ids): - return [(fname, id) for fname, id in files_ids if cls.isArchive(fname)] - - def extract(self, password=None): try: with zipfile.ZipFile(fs_encode(self.filename), 'r', allowZip64=True) as z: z.setpassword(self.password) - if not z.testzip(): + + badfile = z.testzip(): + + if not badfile: z.extractall(self.out) self.files = z.namelist() else: - raise CRCError + raise CRCError(badfile) except (BadZipfile, LargeZipFile), e: raise ArchiveError(e) |