From 592b838db6dc4bc6d869e21d5e5c1bdbfeae803a Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Sat, 20 Apr 2024 11:01:55 +0100 Subject: [PATCH] refactor: update web_pipe() to use web_redirect() --- quickget | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/quickget b/quickget index f97b5f3..0c9eb32 100755 --- a/quickget +++ b/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}" }