mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-19 10:27:07 +01:00
Updated for url filename
This commit is contained in:
parent
5c7c41bb60
commit
191cb576e7
1 changed files with 3 additions and 6 deletions
|
@ -47,7 +47,7 @@ class Downloader(Configs):
|
|||
""" Downloader tools wget, wget2, curl and lftp. """
|
||||
command: str = ''
|
||||
path: str = urlparse(url).path
|
||||
filename: str = Path(path).name
|
||||
filename: str = unquote(Path(path).name)
|
||||
|
||||
if url.startswith('file'):
|
||||
shutil.copy2(url[7:], self.tmp_slpkg)
|
||||
|
@ -65,13 +65,10 @@ class Downloader(Configs):
|
|||
self.errors.raise_error_message(f"Downloader '{self.downloader}' not supported", exit_status=1)
|
||||
|
||||
self.utils.process(command)
|
||||
self.check_if_downloaded(url)
|
||||
self.check_if_downloaded(url, filename)
|
||||
|
||||
def check_if_downloaded(self, url: str) -> None:
|
||||
def check_if_downloaded(self, url: str, filename: str) -> None:
|
||||
""" Checks if the file downloaded. """
|
||||
url: str = unquote(url)
|
||||
path: str = urlparse(url).path
|
||||
filename: str = Path(path).name
|
||||
path_file: Path = Path(self.path, filename)
|
||||
|
||||
if not path_file.exists():
|
||||
|
|
Loading…
Reference in a new issue