@@ -26,7 +26,7 @@ def _create_if_not_exists(path: str, remove=True) -> None:
26
26
27
27
os .makedirs (path , exist_ok = True )
28
28
29
- def download (url : str , filename : str , unzip = False , unzip_path : str = None , force_download = False , force_unzip = False , clean = False ) -> None :
29
+ def download (url : str , filename : str , unzip = False , unzip_path : str = None , force_download = False , clean = False ) -> None :
30
30
"""
31
31
Download a file from a OneDrive url.
32
32
@@ -36,7 +36,6 @@ def download(url: str, filename: str, unzip=False, unzip_path: str = None, force
36
36
:param unzip: Whether to unzip the file.
37
37
:param unzip_path: The path to unzip the file to. Default is current path.
38
38
:param force_download: Whether to force download the file even if it already exists.
39
- :param force_unzip: Whether to force unzip the file even if it already exists.
40
39
:param clean: Whether to clean the unzipped files after unzipping.
41
40
"""
42
41
@@ -75,15 +74,14 @@ def download(url: str, filename: str, unzip=False, unzip_path: str = None, force
75
74
76
75
clean_unzip_path = unzip_path is not None and os .path .realpath (unzip_path ) not in os .path .realpath (filename )
77
76
78
- if unzip_path is None or not os .path .exists (unzip_path ) or force_unzip :
79
- print ("Extracting files..." )
77
+ print ("Extracting files..." )
80
78
81
- _create_if_not_exists (unzip_path , remove = clean_unzip_path )
82
- with zipfile .ZipFile (filename , 'r' ) as zip_ref :
83
- zip_ref .extractall (unzip_path )
79
+ _create_if_not_exists (unzip_path , remove = clean_unzip_path )
80
+ with zipfile .ZipFile (filename , 'r' ) as zip_ref :
81
+ zip_ref .extractall (unzip_path )
84
82
85
- if clean :
86
- os .remove (filename )
83
+ if clean :
84
+ os .remove (filename )
87
85
88
86
except Exception as e :
89
87
print (e )
0 commit comments