From eb0fd031371f72a83cf231bed87ed2d33b1d6452 Mon Sep 17 00:00:00 2001 From: Liam <33645555+lj3954@users.noreply.github.com> Date: Wed, 29 Jan 2025 04:54:23 -0600 Subject: [PATCH] fix: Disregard curl configuration (#1571) --- quickget | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/quickget b/quickget index 451d2a0..9f2755f 100755 --- a/quickget +++ b/quickget @@ -843,7 +843,7 @@ function releases_manjaro() { function releases_mxlinux() { # needs header, so not web_pipe: - curl -Ils "https://sourceforge.net/projects/mx-linux/files/latest/download" | grep -i 'location:' | cut -d? -f1 | cut -d_ -f1 | cut -d- -f3 + curl --disable -Ils "https://sourceforge.net/projects/mx-linux/files/latest/download" | grep -i 'location:' | cut -d? -f1 | cut -d_ -f1 | cut -d- -f3 } function editions_mxlinux() { @@ -1182,12 +1182,12 @@ function check_hash() { # Download a file from the web and pipe it to stdout function web_pipe() { - curl --silent --location "${1}" + curl --disable --silent --location "${1}" } # Download a JSON file from the web and pipe it to stdout function web_pipe_json() { - curl --silent --location --header "Accept: application/json" "${1}" + curl --disable --silent --location --header "Accept: application/json" "${1}" } # Download a file from the web @@ -1240,7 +1240,7 @@ function web_get() { echo "- URL: ${URL}" fi - if ! curl --progress-bar --location --output "${DIR}/${FILE}" --continue-at - --user-agent "${USER_AGENT}" "${HEADERS[@]}" -- "${URL}"; then + if ! curl --disable --progress-bar --location --output "${DIR}/${FILE}" --continue-at - --user-agent "${USER_AGENT}" "${HEADERS[@]}" -- "${URL}"; then echo "ERROR! Failed to download ${URL} with curl." rm -f "${DIR}/${FILE}" fi @@ -1252,7 +1252,7 @@ function web_redirect() { local URL="${1}" # Check for URL redirections # Output to nonexistent directory so the download fails fast - REDIRECT_URL=$(curl --silent --location --fail --write-out '%{url_effective}' --output /var/cache/${RANDOM}/${RANDOM} "${URL}" ) + REDIRECT_URL=$(curl --disable --silent --location --fail --write-out '%{url_effective}' --output /var/cache/${RANDOM}/${RANDOM} "${URL}" ) if [ "${REDIRECT_URL}" != "${URL}" ]; then echo "${REDIRECT_URL}" else @@ -1273,7 +1273,7 @@ function web_check() { shift fi done - curl --silent --location --head --output /dev/null --fail --connect-timeout 30 --max-time 30 --retry 3 "${HEADERS[@]}" "${URL}" + curl --disable --silent --location --head --output /dev/null --fail --connect-timeout 30 --max-time 30 --retry 3 "${HEADERS[@]}" "${URL}" } function zsync_get() { @@ -2078,10 +2078,10 @@ function get_macos() { CHUNKCHECK="$(command -v chunkcheck)" fi - appleSession=$(curl -v -H "Host: osrecovery.apple.com" \ + appleSession=$(curl --disable -v -H "Host: osrecovery.apple.com" \ -H "Connection: close" \ -A "InternetRecovery/1.0" https://osrecovery.apple.com/ 2>&1 | tr ';' '\n' | awk -F'session=|;' '{print $2}' | grep 1) - info=$(curl -s -X POST -H "Host: osrecovery.apple.com" \ + info=$(curl --disable -s -X POST -H "Host: osrecovery.apple.com" \ -H "Connection: close" \ -A "InternetRecovery/1.0" \ -b "session=\"${appleSession}\"" \ @@ -3072,7 +3072,7 @@ function download_windows_server() { local url="https://www.microsoft.com/en-us/evalcenter/download-$windows_version" echo " - Parsing download page: ${url}" - iso_download_page_html="$(curl --silent --location --max-filesize 1M --fail --proto =https --tlsv1.2 --http1.1 -- "$url")" || { + iso_download_page_html="$(curl --disable --silent --location --max-filesize 1M --fail --proto =https --tlsv1.2 --http1.1 -- "$url")" || { handle_curl_error $? return $? } @@ -3145,7 +3145,7 @@ function download_windows_server() { # Follow redirect so proceeding log message is useful # This is a request we make this Fido doesn't # We don't need to set "--max-filesize" here because this is a HEAD request and the output is to /dev/null anyway - iso_download_link="$(curl --silent --location --output /dev/null --silent --write-out "%{url_effective}" --head --fail --proto =https --tlsv1.2 --http1.1 -- "$iso_download_link")" || { + iso_download_link="$(curl --disable --silent --location --output /dev/null --silent --write-out "%{url_effective}" --head --fail --proto =https --tlsv1.2 --http1.1 -- "$iso_download_link")" || { # This should only happen if the Microsoft servers are down handle_curl_error $? return $? @@ -3194,7 +3194,7 @@ function download_windows_workstation() { # Also, keeping a "$WindowsVersions" array like Fido does would be way too much of a maintenance burden # Remove "Accept" header that curl sends by default echo " - Parsing download page: ${url}" - iso_download_page_html="$(curl --silent --user-agent "$user_agent" --header "Accept:" --max-filesize 1M --fail --proto =https --tlsv1.2 --http1.1 -- "$url")" || { + iso_download_page_html="$(curl --disable --silent --user-agent "$user_agent" --header "Accept:" --max-filesize 1M --fail --proto =https --tlsv1.2 --http1.1 -- "$url")" || { handle_curl_error $? return $? } @@ -3208,7 +3208,7 @@ function download_windows_workstation() { echo " - Permit Session ID: $session_id" # Permit Session ID # "org_id" is always the same value - curl --silent --output /dev/null --user-agent "$user_agent" --header "Accept:" --max-filesize 100K --fail --proto =https --tlsv1.2 --http1.1 -- "https://vlscppe.microsoft.com/tags?org_id=y6jn8c31&session_id=$session_id" || { + curl --disable --silent --output /dev/null --user-agent "$user_agent" --header "Accept:" --max-filesize 100K --fail --proto =https --tlsv1.2 --http1.1 -- "https://vlscppe.microsoft.com/tags?org_id=y6jn8c31&session_id=$session_id" || { # This should only happen if there's been some change to how this API works handle_curl_error $? return $? @@ -3218,7 +3218,7 @@ function download_windows_workstation() { echo -n " - Getting language SKU ID: " # Get language -> skuID association table - language_skuid_table_json="$(curl -s --fail --max-filesize 100K --proto =https --tlsv1.2 --http1.1 "https://www.microsoft.com/software-download-connector/api/getskuinformationbyproductedition?profile=${profile}&ProductEditionId=${product_edition_id}&SKU=undefined&friendlyFileName=undefined&Locale=en-US&sessionID=${session_id}")" || { + language_skuid_table_json="$(curl --disable -s --fail --max-filesize 100K --proto =https --tlsv1.2 --http1.1 "https://www.microsoft.com/software-download-connector/api/getskuinformationbyproductedition?profile=${profile}&ProductEditionId=${product_edition_id}&SKU=undefined&friendlyFileName=undefined&Locale=en-US&sessionID=${session_id}")" || { handle_curl_error $? return $? } @@ -3230,7 +3230,7 @@ function download_windows_workstation() { # Get ISO download link # If any request is going to be blocked by Microsoft it's always this last one (the previous requests always seem to succeed) # --referer: Required by Microsoft servers to allow request - iso_download_link_json="$(curl -s --fail --referer "$url" "https://www.microsoft.com/software-download-connector/api/GetProductDownloadLinksBySku?profile=${profile}&productEditionId=undefined&SKU=${sku_id}&friendlyFileName=undefined&Locale=en-US&sessionID=${session_id}")" + iso_download_link_json="$(curl --disable -s --fail --referer "$url" "https://www.microsoft.com/software-download-connector/api/GetProductDownloadLinksBySku?profile=${profile}&productEditionId=undefined&SKU=${sku_id}&friendlyFileName=undefined&Locale=en-US&sessionID=${session_id}")" local failed=0