refactor: update web_pipe() to use web_redirect()
This commit is contained in:
parent
806b1a439f
commit
592b838db6
9
quickget
9
quickget
|
@ -1440,13 +1440,8 @@ function check_hash() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function web_pipe() {
|
function web_pipe() {
|
||||||
# Check for URL redirections
|
local URL=""
|
||||||
# Output to nonexistent directory so the download fails fast
|
URL=$(web_redirect "${1}")
|
||||||
local URL="${1}"
|
|
||||||
local REDIRECT_URL=$(curl --silent --location --fail "${URL}" --write-out %{url_effective} --output /var/cache/${RANDOM}/${RANDOM})
|
|
||||||
if [ "${REDIRECT_URL}" != "${URL}" ]; then
|
|
||||||
URL="${REDIRECT_URL}"
|
|
||||||
fi
|
|
||||||
curl --silent --location "${URL}"
|
curl --silent --location "${URL}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue