mirror of
https://github.com/ksyasuda/aniwrapper.git
synced 2024-10-28 04:44:11 -07:00
docs: added comments
This commit is contained in:
parent
59416e4ef3
commit
4a77126a7c
7
ani-cli
7
ani-cli
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# dependencies: sed curl
|
||||
# dependencies: sed curl mpv
|
||||
|
||||
prog="ani-cli"
|
||||
|
||||
@ -101,6 +101,7 @@ menu_format_string_c2="$c_blue[$c_cyan%d$c_blue] $c_yellow%s$c_reset\n"
|
||||
|
||||
count=1
|
||||
while read anime_id; do
|
||||
# alternating colors for menu
|
||||
[ $((count % 2)) -eq 0 ] &&
|
||||
menu_format_string=$menu_format_string_c1 ||
|
||||
menu_format_string=$menu_format_string_c2
|
||||
@ -111,12 +112,15 @@ done <<EOF
|
||||
$search_results
|
||||
EOF
|
||||
|
||||
# User input
|
||||
printf "$c_blue%s$c_green" "Enter number: "
|
||||
read choice
|
||||
printf "$c_reset"
|
||||
|
||||
# Check if input is a number
|
||||
[ "$choice" -eq "$choice" ] 2>/dev/null || die "Invalid number entered"
|
||||
|
||||
# Select respective anime_id
|
||||
count=1
|
||||
while read anime_id; do
|
||||
if [ $count -eq $choice ]; then
|
||||
@ -156,6 +160,7 @@ while :; do
|
||||
|
||||
case $video_url in
|
||||
*streamtape*)
|
||||
# If direct download not available then scrape streamtape.com
|
||||
BROWSER=${BROWSER:-firefox}
|
||||
printf "scraping streamtape.com\n"
|
||||
video_url=$(curl -s "$video_url" | sed -n -E '
|
||||
|
Loading…
Reference in New Issue
Block a user