This commit is contained in:
CoolnsX
2022-08-11 01:22:11 +05:30
parent 2227568da1
commit 94e91f3cf5
10 changed files with 61 additions and 38 deletions

47
ani-new
View File

@@ -2,8 +2,9 @@
down () {
notify-send "$3 links fetched.." -r $tmp
choice=$(printf "download\nwatch" | dmenu -p "??")
[ "$choice" = "watch" ] && setsid -f mpv --referrer="$1" "$2" && notify-send "opening $url in mpv" -r $tmp && exit 0
choice=$(printf "download\nwatch\nnext mirror" | dmenu -p "??")
[ "$choice" = "watch" ] && setsid -f mpv --referrer="$1" "$2" --force-media-title="$url" && notify-send "opening $url in mpv" -r $tmp && exit 0
[ "$choice" = "next mirror" ] && return 0
notify-send "Downloading $url" -r $tmp
case $2 in
*m3u*)
@@ -14,16 +15,21 @@ down () {
exit 0
}
run () {
curl -s "$base_url?page=1" -A "$agent" | sed -nE 's_.*<a href="/videos/([^"]*)">_\1_p' &
curl -s "$base_url?page=2" -A "$agent" | sed -nE 's_.*<a href="/videos/([^"]*)">_\1_p' &
}
base_url=https://goload.pro
agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36"
agent="Mozilla/5.0 (Linux; Android 11; moto g(9) power) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.41 Mobile Safari/537.36"
trap "exit 0" INT HUP
tmp=$(notify-send "Parsing $base_url.. Please wait..." -p)
url=$(curl -A "$agent" -s "$base_url" | sed -nE 's_.*<a href="/videos/([^"]*)">_\1_p' | dmenu -p "Select Anime: ")
tmp=$(notify-send "Parsing $base_url.. Please wait..." -t 1500 -p)
[ -z "$*" ] && url=$(run | dmenu -p "Select Anime: " -l 20) || url=$*
[ -z "$url" ] && notify-send -u "critical" "No anime selected" -r $tmp && exit 0 || notify-send "Loading Episode $url.." -r $tmp
refr=$(curl -A "$agent" -s "$base_url/videos/$url" | sed -nE 's/.*iframe src="(.*)" al.*/\1/p')
notify-send "Fetching Embed links" -r $tmp
resp="$(curl -A "$agent" -s "https:$refr")"
links=$(printf "%s" "$resp" | sed -nE 's/.*data-status="1".*data-video="(.*)">.*/\1/p')
resp="$(curl -A "$agent" -s "https:$refr" | sed -nE 's/.*class="container-(.*)">/\1/p ; s/.*class="wrapper container-(.*)">/\1/p ; s/.*class=".*videocontent-(.*)">/\1/p ; s/.*data-value="(.*)">.*/\1/p ; s/.*data-status="1".*data-video="(.*)">.*/\1/p')"
links=$(printf "%s" "$resp" | sed -n '5,$ p')
notify-send "Fetching mp4upload links" -r $tmp
mp4up_link=$(printf "$links" | grep "mp4upload")
@@ -37,17 +43,24 @@ sleep 0.5
[ -z "$dood_link" ] || dood_video=$(curl -A "$agent" -s "https://dood.ws${dood_link}" | sed -nE "s/.*window.open.*'(.*)',.*/\1/p")
[ -z "$dood_video" ] || down "https://dood.ws/d/$dood_id" "$dood_video" "doodstream"
notify-send "Fetching goload links" -r $tmp
id=$(printf "%s" "$refr" | sed -nE 's/.*id=(.*)&title.*/\1/p')
secret_key=$(printf "%s" "$resp" | sed -nE 's/.*class="container-(.*)">/\1/p' | tr -d "\n" | od -A n -t x1 | tr -d " |\n")
iv=$(printf "%s" "$resp" | sed -nE 's/.*class="wrapper container-(.*)">/\1/p' | tr -d "\n" | od -A n -t x1 | tr -d " |\n")
second_key=$(printf "%s" "$resp" | sed -nE 's/.*class=".*videocontent-(.*)">/\1/p' | tr -d "\n" | od -A n -t x1 | tr -d " |\n")
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)
video="$(curl -A "$agent" -s -H "X-Requested-With:XMLHttpRequest" "${base_url}/encrypt-ajax.php?id=${ajax}&alias=${id}&${token}" | sed -e 's/{"data":"//' -e 's/"}/\n/' -e 's/\\//g' | 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@:%_\+.~#?&\/\/=]*' | head -4 | tail -1)"
[ -z "$video" ] || down "$base_url" "$video" "goload"
notify-send "Fetching xstreamcdn links" -r $tmp
fb_id=$(printf "$links" | sed -n "s_.*fembed.*/v/__p")
[ -z "$fb_id" ] || fb_video=$(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.*/\1/p' | tail -1)
[ -z "$fb_video" ] || down "https://fembed-hd.com/v/$fb_id" "$fb_video" "xstreamcdn"
id=$(printf "%s" "$refr" | sed -nE 's/.*id=(.*)&title.*/\1/p')
notify-send "Fetching xstreamcdn links" -r $tmp
[ -z "$id" ] || ani_video="$(curl -s "https://animixplay.to/api/live$(printf "%sLTXs3GrU8we9O%s" "$id" "$(printf "$id" | base64)" | base64)" -A "$agent" -I | sed -nE 's_location: (.*)_\1_p' | cut -d"#" -f2 | base64 -d)"
[ -z "$ani_video" ] || down "https://animixplay.to" "$ani_video" "animixplay"
notify-send "Fetching goload links" -r $tmp
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')
ajax=$(printf '%s' "$id" | openssl enc -e -aes256 -K "$secret_key" -iv "$iv" -a)
video="$(curl -A "$agent" -s -H "X-Requested-With:XMLHttpRequest" "${base_url}/encrypt-ajax.php?id=${ajax}&alias=${id}&${token}" | sed -e 's/{"data":"//' -e 's/"}/\n/' -e 's/\\//g' | 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@:%_\+.~#?&\/\/=]*' | head -4 | tail -1)"
[ -z "$video" ] || down "$base_url" "$video" "goload"
notify-send -u critical "no more mirror links..sorry" -r $tmp && exit 0