mirror of
https://codeberg.org/hyperreal/archive-fandom-wiki
synced 2024-11-25 09:33:41 +01:00
Add zip compression support
This commit is contained in:
parent
191192b9a1
commit
fe46295b62
21
afw.py
21
afw.py
@ -226,23 +226,22 @@ class FandomWiki:
|
||||
|
||||
timestamp = datetime.now().strftime("%Y%m%d-%H%M%S")
|
||||
|
||||
with console.status("Archiving images...", spinner="aesthetic"):
|
||||
shutil.make_archive(
|
||||
"images",
|
||||
"xztar",
|
||||
root_dir=self.site_dir,
|
||||
base_dir="images",
|
||||
)
|
||||
shutil.move("images.tar.xz", self.site_dir)
|
||||
shutil.rmtree(self.images_dir)
|
||||
|
||||
with console.status("Archiving web files...", spinner="aesthetic"):
|
||||
with console.status("tar.gzipping downloaded files...", spinner="aesthetic"):
|
||||
shutil.make_archive(
|
||||
f"{self.name}-{timestamp}",
|
||||
"gztar",
|
||||
root_dir=self.archive_rootdir,
|
||||
base_dir=self.canonical_name,
|
||||
)
|
||||
|
||||
with console.status("zipping downloaded files...", spinner="aesthetic"):
|
||||
shutil.make_archive(
|
||||
f"{self.name}-{timestamp}",
|
||||
"zip",
|
||||
root_dir=self.archive_rootdir,
|
||||
base_dir=self.canonical_name,
|
||||
)
|
||||
|
||||
shutil.rmtree(self.site_dir)
|
||||
|
||||
console.log(f"\nTotal web files archived: {total_web_files}")
|
||||
|
Loading…
Reference in New Issue
Block a user