nathanglm commited on
Commit
35addf4
·
verified ·
1 Parent(s): d139b57

Update runpod.io.sh

Browse files
Files changed (1) hide show
  1. runpod.io.sh +6 -6
runpod.io.sh CHANGED
@@ -801,11 +801,11 @@ function provisioning_has_valid_hf_token() {
801
  }
802
 
803
  function provisioning_has_valid_civitai_token() {
804
- [[ -n "$CIVITAI_TOKEN" ]] || return 1
805
  url="https://civitai.com/api/v1/models?hidden=1&limit=1"
806
 
807
  response=$(curl -o /dev/null -s -w "%{http_code}" -X GET "$url" \
808
- -H "Authorization: Bearer $CIVITAI_TOKEN" \
809
  -H "Content-Type: application/json")
810
 
811
  if [ "$response" -eq 200 ]; then
@@ -838,8 +838,8 @@ function download_civitai_bash() {
838
  return 0
839
  fi
840
  printf "Downloading to: %s\n" "$forced_filename"
841
- if [[ -n "$CIVITAI_TOKEN" ]]; then
842
- curl -L -o "$output_file" --progress-bar -H "Authorization: Bearer $CIVITAI_TOKEN" "$url"
843
  else
844
  curl -L -o "$output_file" --progress-bar "$url"
845
  fi
@@ -853,8 +853,8 @@ function download_civitai_bash() {
853
  fi
854
 
855
  local redirect_url=""
856
- if [[ -n "$CIVITAI_TOKEN" ]]; then
857
- redirect_url=$(curl -s -I -L -H "Authorization: Bearer $CIVITAI_TOKEN" "$url" | grep -i "^location:" | tail -1 | sed 's/location: //i' | tr -d '\r\n')
858
  else
859
  redirect_url=$(curl -s -I -L "$url" | grep -i "^location:" | tail -1 | sed 's/location: //i' | tr -d '\r\n')
860
  fi
 
801
  }
802
 
803
  function provisioning_has_valid_civitai_token() {
804
+ [[ -n "a881da881b7c01e808f1fb7843092a11" ]] || return 1
805
  url="https://civitai.com/api/v1/models?hidden=1&limit=1"
806
 
807
  response=$(curl -o /dev/null -s -w "%{http_code}" -X GET "$url" \
808
+ -H "Authorization: Bearer a881da881b7c01e808f1fb7843092a11" \
809
  -H "Content-Type: application/json")
810
 
811
  if [ "$response" -eq 200 ]; then
 
838
  return 0
839
  fi
840
  printf "Downloading to: %s\n" "$forced_filename"
841
+ if [[ -n "a881da881b7c01e808f1fb7843092a11" ]]; then
842
+ curl -L -o "$output_file" --progress-bar -H "Authorization: Bearer a881da881b7c01e808f1fb7843092a11" "$url"
843
  else
844
  curl -L -o "$output_file" --progress-bar "$url"
845
  fi
 
853
  fi
854
 
855
  local redirect_url=""
856
+ if [[ -n "a881da881b7c01e808f1fb7843092a11" ]]; then
857
+ redirect_url=$(curl -s -I -L -H "Authorization: Bearer a881da881b7c01e808f1fb7843092a11" "$url" | grep -i "^location:" | tail -1 | sed 's/location: //i' | tr -d '\r\n')
858
  else
859
  redirect_url=$(curl -s -I -L "$url" | grep -i "^location:" | tail -1 | sed 's/location: //i' | tr -d '\r\n')
860
  fi