From c65aa9afa5c34e93bfa59f97388b67ad876dde25 Mon Sep 17 00:00:00 2001 From: simono41 Date: Fri, 17 Nov 2017 21:24:15 +0100 Subject: [PATCH] parameterfix --- youtube.sh | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/youtube.sh b/youtube.sh index 665f898..061592c 100755 --- a/youtube.sh +++ b/youtube.sh @@ -4,19 +4,24 @@ set -ex if [ "$1" == "--help" ] || [[ -z "$1" ]] then -echo "bitte alles kleinschreiben" -echo "bash ./youtube-dl.sh suche/NOSUCHE URL/SUCHE FORMAT vollbild/NOVOLLBILD" -echo "Formate: [opus/m4a/video/hd/fullhd/4k]" -exit 0 + echo "bitte alles kleinschreiben" + echo "bash ./youtube-dl.sh suche/NOSUCHE URL/SUCHE FORMAT vollbild/NOVOLLBILD" + echo "Formate: [opus/m4a/video/hd/fullhd/4k]" + exit 0 fi -suche="$1" -url="$2" -format="$3" +if [ "$1" == "suche" ] || [ "$1" == "nosuche" ]; then + suche="$1" + url="$2" + format="$3" +else + url="$1" + format="$2" +fi if [ "$4" == "vollbild" ] then -voll="-fs" + voll="-fs" fi #read -p "Wie ist die URL/suche? : " url @@ -45,7 +50,7 @@ fi if [ "$suche" == "suche" ] 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 -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