fix(common): support zip file
This commit is contained in:
@ -229,8 +229,11 @@ def install_archive(game: GameABC, archive_file: Path | IOBase) -> None:
|
|||||||
target_archive = None
|
target_archive = None
|
||||||
if archive_path.suffix == ".001":
|
if archive_path.suffix == ".001":
|
||||||
archive_path = archive_path.with_suffix("")
|
archive_path = archive_path.with_suffix("")
|
||||||
|
if archive_path.suffix == ".zip":
|
||||||
|
# .zip split archive
|
||||||
|
archive = zipfile.ZipFile(archive_path, "r")
|
||||||
|
else:
|
||||||
target_archive = multivolumefile.open(archive_path, mode='rb')
|
target_archive = multivolumefile.open(archive_path, mode='rb')
|
||||||
# TODO: Implement for .zip file (but I doubt it's needed cuz miHoYo uses 7z)
|
|
||||||
archive = py7zr.SevenZipFile(target_archive, "r")
|
archive = py7zr.SevenZipFile(target_archive, "r")
|
||||||
else:
|
else:
|
||||||
archive = _open_archive(archive_file)
|
archive = _open_archive(archive_file)
|
||||||
|
|||||||
Reference in New Issue
Block a user