From 201a4553a2c004bd49bd3a71886a060ce475a2cb Mon Sep 17 00:00:00 2001 From: simono41 Date: Tue, 24 Oct 2017 18:04:08 +0200 Subject: [PATCH] fix --- youtube-pi.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ youtube.sh | 2 +- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100755 youtube-pi.sh diff --git a/youtube-pi.sh b/youtube-pi.sh new file mode 100755 index 0000000..3fc4ffd --- /dev/null +++ b/youtube-pi.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +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 +fi + +suche="$1" +url="$2" +format="$3" + +if [ "$4" == "vollbild" ] +then +voll="-fs" +fi + +#read -p "Wie ist die URL? : " url +#read -p "Wo sollen die Dateien heruntergeladen werden? : " pfad +#read -p "Soll ein Video heruntergeladen werden oder Audio? [opus/m4a/video/hd/fullhd/4k] : " format + +if [ "$format" == "opus" ] +then + format="-f 251" +elif [ "$format" == "m4a" ] +then + format="-f 140" +elif [ "$format" == "video" ] +then + format="-f 43" +elif [ "$format" == "hd" ] +then + format="-f 247+251" +elif [ "$format" == "fullhd" ] +then + format="-f 303+251" +elif [ "$format" == "4k" ] +then + format="-f 315+251" +fi + +if [ "$suche" == "suche" ] +then +youtube-dl "ytsearch:$url" -q --force-ipv4 $format -o- | omxplayer -p -o hdmi $voll -cache 8192 - +else +youtube-dl -q --force-ipv4 $format -o- $url | omxplayer -p -o hdmmi $voll -cache 8192 - +fi diff --git a/youtube.sh b/youtube.sh index 4bfe331..886352e 100755 --- a/youtube.sh +++ b/youtube.sh @@ -45,7 +45,7 @@ fi if [ "$suche" == "suche" ] then -youtube-dl "ytsearch:$wort" -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 - fi