diff --git a/__init__.py b/__init__.py index 9288e45..33f122f 100644 --- a/__init__.py +++ b/__init__.py @@ -1,6 +1,6 @@ from calibre.customize import InterfaceActionBase -VERSION = (3, 33, 0) +VERSION = (3, 33, 1) class WordDumbDumb(InterfaceActionBase): diff --git a/deps.py b/deps.py index 035cc33..cbf9577 100644 --- a/deps.py +++ b/deps.py @@ -174,5 +174,9 @@ def download_word_wise_file( def download_and_extract(url: str, extract_path: Path) -> None: extract_path.parent.mkdir(parents=True, exist_ok=True) - with urlopen(url) as r, bz2.open(r) as bz2_f, extract_path.open("wb") as f: + download_path = extract_path.with_name(url.rsplit("/", 1)[-1]) + with urlopen(url) as r, open(download_path, "wb") as f: + shutil.copyfileobj(r, f) + with bz2.open(download_path) as bz2_f, extract_path.open("wb") as f: shutil.copyfileobj(bz2_f, f) + download_path.unlink()