mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-02-06 08:46:21 +01:00
Fix curl download
This commit is contained in:
parent
3e22d8afa6
commit
6fb918f0af
2 changed files with 5 additions and 3 deletions
|
@ -89,7 +89,8 @@ USE_COLORS=on
|
||||||
# "curl". Default is wget.
|
# "curl". Default is wget.
|
||||||
DOWNDER=wget
|
DOWNDER=wget
|
||||||
|
|
||||||
# Downloader [OPTION]. Pass downloader options. Default for wget is "-c -N".
|
# Downloader [OPTION]. Pass downloader options. For curl use "-o" as
|
||||||
|
# using to download in specific directory. Default for wget is "-c -N".
|
||||||
DOWNDER_OPTIONS=-c -N
|
DOWNDER_OPTIONS=-c -N
|
||||||
|
|
||||||
# Update slackpkg ChangeLog.txt file if SLACKPKG_LOG is "on".
|
# Update slackpkg ChangeLog.txt file if SLACKPKG_LOG is "on".
|
||||||
|
|
|
@ -49,6 +49,7 @@ class Download(object):
|
||||||
for dwn in self.url:
|
for dwn in self.url:
|
||||||
self.file_name = dwn.split("/")[-1]
|
self.file_name = dwn.split("/")[-1]
|
||||||
self._check_certificate()
|
self._check_certificate()
|
||||||
|
print self.downder, self.downder_options, dwn, self.path
|
||||||
print("\n[{0}/{1}][ {2}Download{3} ] --> {4}\n".format(
|
print("\n[{0}/{1}][ {2}Download{3} ] --> {4}\n".format(
|
||||||
dwn_count, len(self.url), self.meta.color["GREEN"],
|
dwn_count, len(self.url), self.meta.color["GREEN"],
|
||||||
self.meta.color["ENDC"],
|
self.meta.color["ENDC"],
|
||||||
|
@ -60,9 +61,9 @@ class Download(object):
|
||||||
self.dir_prefix, self.path, dwn),
|
self.dir_prefix, self.path, dwn),
|
||||||
shell=True)
|
shell=True)
|
||||||
elif self.downder == "curl":
|
elif self.downder == "curl":
|
||||||
subprocess.call("{0} {1} {2} {3}".format(
|
subprocess.call("{0} {1} {2}{3} {4}".format(
|
||||||
self.downder, self.downder_options,
|
self.downder, self.downder_options,
|
||||||
dwn, self.path), shell=True)
|
self.path, self.file_name, dwn), shell=True)
|
||||||
self._check_if_downloaded()
|
self._check_if_downloaded()
|
||||||
dwn_count += 1
|
dwn_count += 1
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
|
Loading…
Add table
Reference in a new issue