I'm downloading a zip file from google drive using torch download_file_from_google_drive
with corresponding file_id i'm trying:
download_file_from_google_drive(file_id=file_id, root=str(Path(".")), filename="filename.zip")
download a file which has the same size what i want to download but when i try to read it or extract it i get
OSError 22
from python or Archive is broken from b1freearchiver i don't know where the problem starts. Any help is appreciated.
def _extract_zip(from_path: str, to_path: str, compression: Optional[str]) -> None:
with zipfile.Zipfile(
from_path, "r", compression=_ZIP_COMPRESSION_MAP[compression] if compression else zipfile.ZIP_STORED) as zip:
zip.extractall(to_path)
_extract_zip(str(Path(".") / "filename.zip"), str(Path("."))