Files
repos_scripts/ani-new
2022-03-02 22:20:36 +05:30

20 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36"
decrypt_link() {
ajax_url='https://gogoplay.io/encrypt-ajax.php'
video_id=$(printf "$1" | cut -d\? -f2 | cut -d\& -f1 | sed 's/id=//g')
secret_key='3235373436353338353932393338333936373634363632383739383333323838'
iv='34323036393133333738303038313335'
ajax=$(printf "$video_id" | openssl enc -aes256 -K "$secret_key" -iv "$iv" -a)
curl -s -H "X-Requested-With:XMLHttpRequest" -H "User-Agent:$agent" -H "Referer:https:$1" "$ajax_url" -d "id=$ajax" -d "time=69420691337800813569" | jq -r '.source[].file' | head -4 | tail -1
}
notify-send -t 1000 "parsing gogoanime.... please wait!!"
url=$(curl -s -A "$agent" "https://gogoanime.film" | sed -nE 's/.*"name".*href="\/([^"]*)".*/\1/p' | dmenu -p "Select anime:")
[ -z "$url" ] && notify-send -u critical "Err.. no anime selected" && exit 0
refr=$(curl -s -A "$agent" "https://gogoanime.film/$url" | sed -n -E 's/^[[:space:]]*<a href="#" rel="100" data-video="([^"]*)".*/\1/p')
video=$(decrypt_link "$refr")
notify-send "Downloading $url"
st -e aria2c --summary-interval=0 -x 16 -s 16 -U "$agent" --referer="https:$refr" "$video" --dir=MOVIES -o "$url.mp4" --download-result=hide && notify-send "Downloaded $url"