#!/bin/sh decrypt_link() { secret_key='3633393736383832383733353539383139363339393838303830383230393037' iv='34373730343738393639343138323637' ajax_url="https://gogoplay5.com/encrypt-ajax.php" id=$(printf "%s" "$1" | sed -nE 's/.*id=(.*)&title.*/\1/p') ajax=$(printf "%s" "$id" | openssl enc -e -aes256 -K "$secret_key" -iv "$iv" | base64) data=$(curl -s -H "X-Requested-With:XMLHttpRequest" "$ajax_url" -d "id=$ajax" | sed -e 's/{"data":"//' -e 's/"}/\n/' -e 's/\\//g') printf "$data" | base64 -d | openssl enc -d -aes256 -K "$secret_key" -iv "$iv" | sed -e 's/\].*/\]/' -e 's/\\//g' | grep -Eo 'https:\/\/[-a-zA-Z0-9@:%._\+~#=][a-zA-Z0-9][-a-zA-Z0-9@:%_\+.~#?&\/\/=]*' | head -4 | tail -1 } notify-send -t 1000 "parsing gogoplay5.... please wait!!" url=$(curl -s "https://gogoplay5.com" | sed -nE 's_.*_\1_p' | dmenu -l 15 -p "Select anime:") [ -z "$url" ] && notify-send -u critical "Err.. no anime selected" && exit 0 refr=$(curl -s "https://gogoplay5.com/videos/$url" | sed -nE 's/.*iframe src="([^"]*)".*/\1/p') video=$(decrypt_link "$refr") choice=$(printf "download\nwatch" | dmenu -p "??" ) [ "$choice" = "watch" ] && notify-send "Opening $url in mpv" && setsid -f mpv --referrer="https://gogoplay5.com" "$video" && exit 0 notify-send "Downloading $url" case $video in *mp4*) st -e aria2c --summary-interval=0 -x 16 -s 16 --referer="https:$refr" "$video" --dir=movies -o "$url.mp4" --download-result=hide && notify-send "Downloaded $url" || exit 0;; *m3u*) st -e ffmpeg -loglevel error -stats -referer "https:$refr" -i "$video" -c copy "movies/$url.mp4" && notify-send "Downloaded $url" || exit 0;; esac