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() {
|
||||
# Check for URL redirections
|
||||
# Output to nonexistent directory so the download fails fast
|
||||
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
|
||||
local URL=""
|
||||
URL=$(web_redirect "${1}")
|
||||
curl --silent --location "${URL}"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue