notes/BASH Menu List with Whiptail to Download Videos from URL-2kBMWXBn.sh
#!/bin/bash
TITLE="Select One"
MENU="Make a Choice"
url="http://www.aniprop.com/wp-content/uploads/2017/04/"
mapfile -t urls < <(lynx --dump "$url" |grep "Death-Note"|grep " http"|awk '{print $2}')
function getList(){
# printf "%s\n" "${urls[@]}"|while read line
# do
# echo "\"$(basename "$line")\" \"-\""
# done
for (( i=0; i<${#urls[@]}; i++ ));
do
echo "$i \"$(basename ${urls[i]})\"";
done
}
s="$(whiptail --title "$TITLE" --menu "MENU" 16 100 9 $(getList) 3>&2 2>&1 1>&3)"
echo "${urls[s]}"
#wget "${urls[s]}"
mpv "${urls[s]}"
syntax highlighted by Code2HTML, v. 0.9.1