1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-23 14:41:47 +00:00

fix unsupported archive error (#619)

This commit is contained in:
Alex Xu
2023-11-28 06:53:58 -08:00
committed by GitHub
parent 3090a47f20
commit 6dcaf9a6d1

View File

@@ -46,11 +46,7 @@ class ComicArchive:
self.type = line.rstrip().split(' ')[1].upper() self.type = line.rstrip().split(' ')[1].upper()
break break
if process.returncode != 0: if process.returncode != 0:
raise OSError('Archive is corrupted or encrypted.') raise OSError(process.stdout.strip())
elif self.type not in ['7Z', 'RAR', 'RAR5', 'ZIP']:
raise OSError('Unsupported archive format.')
elif self.type not in ['7Z', 'RAR', 'RAR5', 'ZIP']:
raise OSError('Unsupported archive format.')
def extract(self, targetdir): def extract(self, targetdir):
if not os.path.isdir(targetdir): if not os.path.isdir(targetdir):