parameterfix

This commit is contained in:
simono41 2017-11-17 21:24:15 +01:00
parent a0055d612a
commit c65aa9afa5

View file

@ -4,19 +4,24 @@ set -ex
if [ "$1" == "--help" ] || [[ -z "$1" ]] if [ "$1" == "--help" ] || [[ -z "$1" ]]
then then
echo "bitte alles kleinschreiben" echo "bitte alles kleinschreiben"
echo "bash ./youtube-dl.sh suche/NOSUCHE URL/SUCHE FORMAT vollbild/NOVOLLBILD" echo "bash ./youtube-dl.sh suche/NOSUCHE URL/SUCHE FORMAT vollbild/NOVOLLBILD"
echo "Formate: [opus/m4a/video/hd/fullhd/4k]" echo "Formate: [opus/m4a/video/hd/fullhd/4k]"
exit 0 exit 0
fi fi
suche="$1" if [ "$1" == "suche" ] || [ "$1" == "nosuche" ]; then
url="$2" suche="$1"
format="$3" url="$2"
format="$3"
else
url="$1"
format="$2"
fi
if [ "$4" == "vollbild" ] if [ "$4" == "vollbild" ]
then then
voll="-fs" voll="-fs"
fi fi
#read -p "Wie ist die URL/suche? : " url #read -p "Wie ist die URL/suche? : " url
@ -45,7 +50,7 @@ fi
if [ "$suche" == "suche" ] if [ "$suche" == "suche" ]
then then
youtube-dl "ytsearch:$url" -q --force-ipv4 $format -o- | mplayer $voll -cache 8192 - youtube-dl "ytsearch:$url" -q --force-ipv4 $format -o- | mplayer $voll -cache 8192 -
else else
youtube-dl -q --force-ipv4 $format -o- $url | mplayer $voll -cache 8192 - youtube-dl -q --force-ipv4 $format -o- $url | mplayer $voll -cache 8192 -
fi fi