diff --git a/ani-cli b/ani-cli
index e2cee8e..320b745 100755
--- a/ani-cli
+++ b/ani-cli
@@ -94,7 +94,7 @@ generate_link() {
[ -z "$id" ] && return 0
enc_id=$(printf "%s" "$id" | base64)
ani_id=$(printf "%sLTXs3GrU8we9O%s" "$id" "$enc_id" | base64)
- result_links="$(curl -s "$BASE_URL/api/live${ani_id}" -A "$AGENT" -I | sed -nE 's_location: (.*)_\1_p' | cut -d"#" -f2 | base64 -d)"
+ result_links="$(curl -s "$BASE_URL/api/cW9${ani_id}" -A "$AGENT" -I | sed -nE 's_[L|l]ocation: https?://[^#]*#([^#]*).*_\1_p' | base64 --decode)"
;;
2)
provider_name='Xstreamcdn'
@@ -113,11 +113,11 @@ generate_link() {
secret_key=$(printf "%s" "$resp" | sed -n '2p' | tr -d "\n" | od -A n -t x1 | tr -d " |\n")
iv=$(printf "%s" "$resp" | sed -n '3p' | tr -d "\n" | od -A n -t x1 | tr -d " |\n")
second_key=$(printf "%s" "$resp" | sed -n '4p' | tr -d "\n" | od -A n -t x1 | tr -d " |\n")
- token=$(printf "%s" "$resp" | head -1 | base64 -d | openssl enc -d -aes256 -K "$secret_key" -iv "$iv" | sed -nE 's/.*&(token.*)/\1/p')
+ token=$(printf "%s" "$resp" | head -1 | base64 --decode | openssl enc -d -aes256 -K "$secret_key" -iv "$iv" | sed -nE 's/.*&(token.*)/\1/p')
ajax=$(printf '%s' "$id" | openssl enc -e -aes256 -K "$secret_key" -iv "$iv" -a)
data=$(curl -A "$AGENT" -sL -H "X-Requested-With:XMLHttpRequest" "${GOGOHD_URL}encrypt-ajax.php?id=${ajax}&alias=${id}&${token}" | sed -e 's/{"data":"//' -e 's/"}/\n/' -e 's/\\//g')
- result_links="$(printf '%s' "$data" | base64 -d 2> /dev/null | openssl enc -d -aes256 -K "$second_key" -iv "$iv" 2> /dev/null |
- sed -e 's/\].*/\]/' -e 's/\\//g' | grep -Eo 'https:\/\/[-a-zA-Z0-9@:%._\+~#=][a-zA-Z0-9][-a-zA-Z0-9@:%_\+.~#?&\/\/=]*')"
+ result_links="$(printf '%s' "$data" | base64 --decode 2> /dev/null | openssl enc -d -aes256 -K "$second_key" -iv "$iv" 2> /dev/null |
+ tr -d \\\\ | sed -nE "s_.*file\":\"([^\"]*)\".*source.*_\1_p")"
;;
esac
printf '%s' "$video_url"
@@ -217,7 +217,7 @@ search_anime() {
fi
lg "Search Query: $search"
curl -s "https://gogoanime.dk//search.html?keyword=$search" -L |
- sed -nE 's_^[[:space:]]*$_\1_p'
+ sed -nE "s_^[[:space:]]*\$_\1_p"
}
# only lets the user pass in case of a valid search