11-21-2016, 10:10 AM
Don't change any of the code, keep it as it is, and there is no need for sudo. Right click on the file, and select 'Make file executable'. Should be fine then. Selecting 480p should suit your setup.
Updated:
Updated:
Code:
#!/bin/sh
# YouTerm by Jerry Bezencon, pdq 2013.
# Requirements: VLC Media Player
# check vlc is available
type vlc >/dev/null 2>/dev/null || {
echo "Couldn't find VLC, which is required for this script." >&2
exit 17
}
bold=`tput bold`
normal=`tput sgr0`
clear
echo "${bold}************************************************"
echo "YouTerm - Watch Youtube videos without a browser"
echo "************************************************${normal}"
echo ""
echo "This utility will also stream a number of other formats including:"
echo ".ogg .mp4 .mp3 .wmv .mov .mpeg .mpg .asf .rm"
echo ""
echo "Choose Option ${bold}'Other Streams'${normal} after inputting the url to stream the above formats."
echo ""
youterm_url() {
echo -n "Input the url: "
read url
if [ "$url" = "" ]; then
youterm_url
fi
echo ""
}
youterm_res() {
echo "[1] 240p"
echo "[2] 360p"
echo "[3] 480p"
echo "[4] 720p"
echo "[5] 1080p"
echo "[6] 1440p"
echo "[7] 2160p (4k)"
echo "[8] Other Streams"
echo "[9] Exit"
echo -n "Enter your menu choice [1-9]: "
read res
if [ "$res" = "" ]; then
youterm_res
fi
case $res in
1) vlc --preferred-resolution "240p" $url --play-and-exit ;;
2) vlc --preferred-resolution "360p" $url --play-and-exit ;;
3) vlc --preferred-resolution "480p" $url --play-and-exit ;;
4) vlc --preferred-resolution "720p" $url --play-and-exit ;;
5) vlc --preferred-resolution "1080p" $url --play-and-exit ;;
6) vlc --preferred-resolution "1440p" $url --play-and-exit ;;
7) vlc --preferred-resolution "2160p (4k)" $url --play-and-exit ;;
8) vlc -vvv $url --play-and-exit ;;
9) exit 9 ;;
*) youterm_res ;;
esac
}
while true
do
youterm_url
youterm_res
exit 0
done