feat: no more browser :)

This commit is contained in:
Harshith 2021-06-09 20:26:57 +05:30
parent 104fce46e1
commit 7bd821e050

22
ani-cli
View File

@ -137,22 +137,18 @@ while :; do
video_url=$(get_links "$selection_id" "$ep_choice") video_url=$(get_links "$selection_id" "$ep_choice")
case $video_url in case $video_url in
*stream*) *streamtape*)
BROWSER=${BROWSER:-firefox} BROWSER=${BROWSER:-firefox}
printf "Downloadable mp4 not found, stream on browser?[y/N] " printf "scraping streamtape.com\n"
read choice video_url=$(curl -s "$video_url" | sed -n -E '
case $choice in /^<script>document/{
[yY]) setsid -f $BROWSER "$video_url" >/dev/null 2>&1 s/^[^"]*"([^"]*)" \+ '\''([^'\'']*).*/https:\1\2\&dl=1/p
;; q
*) }
exit 0 ');;
;;
esac esac
;;
*)
setsid -f mpv "$video_url" >/dev/null 2>&1 setsid -f mpv "$video_url" >/dev/null 2>&1
;;
esac
printf "\nCurrently playing %s episode %d/%d\n" "$selection_id" $ep_choice $last_ep_number printf "\nCurrently playing %s episode %d/%d\n" "$selection_id" $ep_choice $last_ep_number
printf "[n] next episode\n" printf "[n] next episode\n"