fix: Disregard curl configuration (#1571)
This commit is contained in:
parent
0c772d5619
commit
eb0fd03137
28
quickget
28
quickget
|
@ -843,7 +843,7 @@ function releases_manjaro() {
|
||||||
|
|
||||||
function releases_mxlinux() {
|
function releases_mxlinux() {
|
||||||
# needs header, so not web_pipe:
|
# 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() {
|
function editions_mxlinux() {
|
||||||
|
@ -1182,12 +1182,12 @@ function check_hash() {
|
||||||
|
|
||||||
# Download a file from the web and pipe it to stdout
|
# Download a file from the web and pipe it to stdout
|
||||||
function web_pipe() {
|
function web_pipe() {
|
||||||
curl --silent --location "${1}"
|
curl --disable --silent --location "${1}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Download a JSON file from the web and pipe it to stdout
|
# Download a JSON file from the web and pipe it to stdout
|
||||||
function web_pipe_json() {
|
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
|
# Download a file from the web
|
||||||
|
@ -1240,7 +1240,7 @@ function web_get() {
|
||||||
echo "- URL: ${URL}"
|
echo "- URL: ${URL}"
|
||||||
fi
|
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."
|
echo "ERROR! Failed to download ${URL} with curl."
|
||||||
rm -f "${DIR}/${FILE}"
|
rm -f "${DIR}/${FILE}"
|
||||||
fi
|
fi
|
||||||
|
@ -1252,7 +1252,7 @@ function web_redirect() {
|
||||||
local URL="${1}"
|
local URL="${1}"
|
||||||
# Check for URL redirections
|
# Check for URL redirections
|
||||||
# Output to nonexistent directory so the download fails fast
|
# 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
|
if [ "${REDIRECT_URL}" != "${URL}" ]; then
|
||||||
echo "${REDIRECT_URL}"
|
echo "${REDIRECT_URL}"
|
||||||
else
|
else
|
||||||
|
@ -1273,7 +1273,7 @@ function web_check() {
|
||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
done
|
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() {
|
function zsync_get() {
|
||||||
|
@ -2078,10 +2078,10 @@ function get_macos() {
|
||||||
CHUNKCHECK="$(command -v chunkcheck)"
|
CHUNKCHECK="$(command -v chunkcheck)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
appleSession=$(curl -v -H "Host: osrecovery.apple.com" \
|
appleSession=$(curl --disable -v -H "Host: osrecovery.apple.com" \
|
||||||
-H "Connection: close" \
|
-H "Connection: close" \
|
||||||
-A "InternetRecovery/1.0" https://osrecovery.apple.com/ 2>&1 | tr ';' '\n' | awk -F'session=|;' '{print $2}' | grep 1)
|
-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" \
|
-H "Connection: close" \
|
||||||
-A "InternetRecovery/1.0" \
|
-A "InternetRecovery/1.0" \
|
||||||
-b "session=\"${appleSession}\"" \
|
-b "session=\"${appleSession}\"" \
|
||||||
|
@ -3072,7 +3072,7 @@ function download_windows_server() {
|
||||||
local url="https://www.microsoft.com/en-us/evalcenter/download-$windows_version"
|
local url="https://www.microsoft.com/en-us/evalcenter/download-$windows_version"
|
||||||
|
|
||||||
echo " - Parsing download page: ${url}"
|
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 $?
|
handle_curl_error $?
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
@ -3145,7 +3145,7 @@ function download_windows_server() {
|
||||||
# Follow redirect so proceeding log message is useful
|
# Follow redirect so proceeding log message is useful
|
||||||
# This is a request we make this Fido doesn't
|
# 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
|
# 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
|
# This should only happen if the Microsoft servers are down
|
||||||
handle_curl_error $?
|
handle_curl_error $?
|
||||||
return $?
|
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
|
# 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
|
# Remove "Accept" header that curl sends by default
|
||||||
echo " - Parsing download page: ${url}"
|
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 $?
|
handle_curl_error $?
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
@ -3208,7 +3208,7 @@ function download_windows_workstation() {
|
||||||
echo " - Permit Session ID: $session_id"
|
echo " - Permit Session ID: $session_id"
|
||||||
# Permit Session ID
|
# Permit Session ID
|
||||||
# "org_id" is always the same value
|
# "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
|
# This should only happen if there's been some change to how this API works
|
||||||
handle_curl_error $?
|
handle_curl_error $?
|
||||||
return $?
|
return $?
|
||||||
|
@ -3218,7 +3218,7 @@ function download_windows_workstation() {
|
||||||
|
|
||||||
echo -n " - Getting language SKU ID: "
|
echo -n " - Getting language SKU ID: "
|
||||||
# Get language -> skuID association table
|
# 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 $?
|
handle_curl_error $?
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
@ -3230,7 +3230,7 @@ function download_windows_workstation() {
|
||||||
# Get ISO download link
|
# 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)
|
# 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
|
# --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
|
local failed=0
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue