Update krea.sh
Browse files
krea.sh
CHANGED
|
@@ -851,11 +851,11 @@ function provisioning_has_valid_hf_token() {
|
|
| 851 |
}
|
| 852 |
|
| 853 |
function provisioning_has_valid_civitai_token() {
|
| 854 |
-
[[ -n "
|
| 855 |
url="https://civitai.com/api/v1/models?hidden=1&limit=1"
|
| 856 |
|
| 857 |
response=$(curl -o /dev/null -s -w "%{http_code}" -X GET "$url" \
|
| 858 |
-
-H "Authorization: Bearer
|
| 859 |
-H "Content-Type: application/json")
|
| 860 |
|
| 861 |
if [ "$response" -eq 200 ]; then
|
|
@@ -888,8 +888,8 @@ function download_civitai_bash() {
|
|
| 888 |
return 0
|
| 889 |
fi
|
| 890 |
printf "Downloading to: %s\n" "$forced_filename"
|
| 891 |
-
if [[ -n "
|
| 892 |
-
curl -fL -o "$output_file" --progress-bar -H "Authorization: Bearer
|
| 893 |
else
|
| 894 |
curl -fL -o "$output_file" --progress-bar "$url"
|
| 895 |
fi
|
|
@@ -904,8 +904,8 @@ function download_civitai_bash() {
|
|
| 904 |
fi
|
| 905 |
|
| 906 |
local redirect_url=""
|
| 907 |
-
if [[ -n "
|
| 908 |
-
redirect_url=$(curl -s -I -L -H "Authorization: Bearer
|
| 909 |
else
|
| 910 |
redirect_url=$(curl -s -I -L "$url" | grep -i "^location:" | tail -1 | sed 's/location: //i' | tr -d '\r\n')
|
| 911 |
fi
|
|
|
|
| 851 |
}
|
| 852 |
|
| 853 |
function provisioning_has_valid_civitai_token() {
|
| 854 |
+
[[ -n "ee2791108127cd78eb0217b6207b4fe2" ]] || return 1
|
| 855 |
url="https://civitai.com/api/v1/models?hidden=1&limit=1"
|
| 856 |
|
| 857 |
response=$(curl -o /dev/null -s -w "%{http_code}" -X GET "$url" \
|
| 858 |
+
-H "Authorization: Bearer ee2791108127cd78eb0217b6207b4fe2" \
|
| 859 |
-H "Content-Type: application/json")
|
| 860 |
|
| 861 |
if [ "$response" -eq 200 ]; then
|
|
|
|
| 888 |
return 0
|
| 889 |
fi
|
| 890 |
printf "Downloading to: %s\n" "$forced_filename"
|
| 891 |
+
if [[ -n "ee2791108127cd78eb0217b6207b4fe2" ]]; then
|
| 892 |
+
curl -fL -o "$output_file" --progress-bar -H "Authorization: Bearer ee2791108127cd78eb0217b6207b4fe2" "$url"
|
| 893 |
else
|
| 894 |
curl -fL -o "$output_file" --progress-bar "$url"
|
| 895 |
fi
|
|
|
|
| 904 |
fi
|
| 905 |
|
| 906 |
local redirect_url=""
|
| 907 |
+
if [[ -n "ee2791108127cd78eb0217b6207b4fe2" ]]; then
|
| 908 |
+
redirect_url=$(curl -s -I -L -H "Authorization: Bearer ee2791108127cd78eb0217b6207b4fe2" "$url" | grep -i "^location:" | tail -1 | sed 's/location: //i' | tr -d '\r\n')
|
| 909 |
else
|
| 910 |
redirect_url=$(curl -s -I -L "$url" | grep -i "^location:" | tail -1 | sed 's/location: //i' | tr -d '\r\n')
|
| 911 |
fi
|