From ce83a6155be69fc87dc2b7521639f44738ec3643 Mon Sep 17 00:00:00 2001 From: ksyasuda Date: Tue, 3 May 2022 20:36:02 -0700 Subject: [PATCH] fix same episode playing --- ani-cli | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ani-cli b/ani-cli index 888ac48..e85cf40 100755 --- a/ani-cli +++ b/ani-cli @@ -110,20 +110,20 @@ generate_link() { case "$1" in 1) refr=$(printf "%s" "$links" | grep "mp4upload") - [ -z "$refr" ] || video_links="$(curl -A "$AGENT" -s "$refr" -H "DNT: 1" | sed -nE 's_.*embed\|(.*)\|.*blank.*\|(.*)\|(.*)\|(.*)\|(.*)\|src.*_https://\1.mp4upload.com:\5/d/\4/\3.\2_p')" + [ -z "$refr" ] || result_links="$(curl -A "$AGENT" -s "$refr" -H "DNT: 1" | sed -nE 's_.*embed\|(.*)\|.*blank.*\|(.*)\|(.*)\|(.*)\|(.*)\|src.*_https://\1.mp4upload.com:\5/d/\4/\3.\2_p')" ;; 2) dood_id=$(printf "%s" "$links" | sed -n "s_.*dood.*/e/__p") refr="https://dood.ws/d/$dood_id" [ -z "$dood_id" ] || dood_link=$(curl -A "$AGENT" -s "https://dood.ws/d/$dood_id" | sed -nE 's/\1/p')" + [ -z "$fb_id" ] || result_links="$(curl -A "$AGENT" -s -X POST "https://fembed-hd.com/api/source/$fb_id" -H "x-requested-with:XMLHttpRequest" | sed -e 's/\\//g' -e 's/.*data"://' | tr "}" "\n" | sed -nE 's/.*file":"(.*)","label":"(.*)","type.*/\2>\1/p')" ;; *) ajax_url="$BASE_URL/encrypt-ajax.php" @@ -135,7 +135,7 @@ generate_link() { token=$(printf "%s" "$resp" | sed -nE 's/.*data-value="(.*)">.*/\1/p' | base64 -d | 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" | base64) data=$(curl -A "$AGENT" -s -H "X-Requested-With:XMLHttpRequest" "${ajax_url}?id=${ajax}&alias=${id}&${token}" | sed -e 's/{"data":"//' -e 's/"}/\n/' -e 's/\\//g') - video_links="$(printf '%s' "$data" | base64 -d | openssl enc -d -aes256 -K "$second_key" -iv "$iv" | 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 -d | openssl enc -d -aes256 -K "$second_key" -iv "$iv" | sed -e 's/\].*/\]/' -e 's/\\//g' | grep -Eo 'https:\/\/[-a-zA-Z0-9@:%._\+~#=][a-zA-Z0-9][-a-zA-Z0-9@:%_\+.~#?&\/\/=]*')" ;; esac lg "END: generate_link()" > /dev/stderr @@ -201,10 +201,12 @@ get_video_link() { i=4 fi links=$(printf "%s" "$resp" | sed -nE 's/.*data-status="1".*data-video="(.*)">.*/\1/p') - while [ -z "$video_links" ]; do + while [ "$i" -ge 1 ] && [ "$i" -le 4 ] && [ -z "$result_links" ]; do generate_link "$i" [ "$is_download" -eq 1 ] && i=$((i + 1)) || i=$((i - 1)) done + video_links="$result_links" + unset result_links if printf '%s' "$video_links" | grep -q "m3u8"; then is_m3u8=1 video_url="$video_links"