This commit is contained in:
simono41 2018-03-24 02:41:06 +01:00
parent 50638cc187
commit ba391cd962

View file

@ -4,19 +4,25 @@ 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 OUTPUT"
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"
output="$4"
else
url="$1"
format="$2"
output="$3"
fi
if [ "$4" == "vollbild" ] if [ -z ${output} ]; then
then output="hdmi"
voll="-fs"
fi fi
#read -p "Wie ist die URL? : " url #read -p "Wie ist die URL? : " url
@ -45,7 +51,7 @@ fi
if [ "$suche" == "suche" ] if [ "$suche" == "suche" ]
then then
youtube-dl "ytsearch:$url" -q --force-ipv4 $format -o- | omxplayer -p -o hdmi $voll -cache 8192 - omxplayer -p -o ${output} `youtube-dl -g "ytsearch:$url" -q --force-ipv4 $format`
else else
youtube-dl -q --force-ipv4 $format -o- $url | omxplayer -p -o hdmmi $voll -cache 8192 - omxplayer -p -o ${output} `youtube-dl -g $url -q --force-ipv4 $format`
fi fi