diff --git a/ani-cli b/ani-cli index bff1df3..ce1ae95 100755 --- a/ani-cli +++ b/ani-cli @@ -4,7 +4,7 @@ # video_player ( needs to be able to play urls ) player_fn="mpv" prog="ani-cli" -site="gogoanime.wiki" +site="gogoanime.film" c_red="\033[1;31m" c_green="\033[1;32m" @@ -75,9 +75,10 @@ get_links () { link=$(curl -s "$sb_url" | sed -n -E 's/.*a href="#" onclick="download_video([^"]*)".*/\1/p') i=$(printf "$link" | cut -d\' -f2 | head -1) - m=$(printf "$link" | cut -d\' -f4 | fzf) h=$(printf "$link" | cut -d\' -f6 | head -1) - curl -s "https://sbplay2.com/dl?op=download_orig&id=$i&mode=$m&hash=$h" | sed -n -E 's/ /dev/null 2>&1 + setsid -f $player_fn --http-header-fields="Referer: https://sbplay2.com" "$video_url" > /dev/null 2>&1 else printf "Downloading episode $episode ...\n" # add 0 padding to the episode name episode=$(printf "%03d" $episode) { - aria2c -x 16 -s 16 -U "Mozilla/5.0" "$video_url" --dir=MOVIES -o "${anime_id}-${episode}.mp4" --download-result=hide && + aria2c -x 16 -s 16 --referer="https://sbplay2.com" "$video_url" --dir=MOVIES -o "${anime_id}-${episode}.mp4" --download-result=hide && printf "${c_green}Downloaded episode: %s${c_reset}\n" "$episode" || printf "${c_red}Download failed episode: %s${c_reset}\n" "$episode" }