From 4d8d4c9c61cb911b0647b34c14d0f6ad2d7f9436 Mon Sep 17 00:00:00 2001 From: user1 Date: Mon, 30 Aug 2021 22:59:23 +0200 Subject: [PATCH] fix youtube-scripts --- youtube-vlc.sh | 9 ++++++--- youtube-vlc_windows.sh | 9 ++++++--- youtube.sh | 9 ++++++--- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/youtube-vlc.sh b/youtube-vlc.sh index 7779490..c531833 100644 --- a/youtube-vlc.sh +++ b/youtube-vlc.sh @@ -5,12 +5,12 @@ set -ex if [ "$1" == "--help" ] || [[ -z "$1" ]] then echo "bitte alles kleinschreiben" - echo "bash ./youtube-dl.sh suche/NOSUCHE URL/SUCHE FORMAT" + echo "bash ./youtube-dl.sh suche/search URL/stichwort FORMAT" echo "Formate: [opus/m4a/video/hd/fullhd/fullhdmp4/4k/FORMAT]" exit 0 fi -if [ "$1" == "suche" ] || [ "$1" == "nosuche" ]; then +if [ "$1" == "suche" ] || [ "$1" == "search" ]; then suche="$1" url="$2" format="$3" @@ -45,15 +45,17 @@ elif [ -n "$format" ]; then fi video="" -if [ "$suche" == "suche" ] +if [ "$suche" == "suche" ] || [ "$suche" == "search" ] then if ! youtube-dl "ytsearch:$url" -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --no-playlist $format; then echo "Download fehlgeschlagen" + exit 1 fi video=$(youtube-dl "ytsearch:$url" -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --no-playlist --get-filename $format) else if ! youtube-dl -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --no-playlist $format $url; then echo "Download fehlgeschlagen" + exit 1 fi video=$(youtube-dl -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --no-playlist --get-filename $format $url) fi @@ -62,4 +64,5 @@ if [ "${video}" != "" ]; then vlc ${video} else echo "Konnte Video nicht finden" + exit 1 fi diff --git a/youtube-vlc_windows.sh b/youtube-vlc_windows.sh index 57a5dc7..c0d722a 100644 --- a/youtube-vlc_windows.sh +++ b/youtube-vlc_windows.sh @@ -5,12 +5,12 @@ set -ex if [ "$1" == "--help" ] || [[ -z "$1" ]] then echo "bitte alles kleinschreiben" - echo "bash ./youtube-dl.sh suche/NOSUCHE URL/SUCHE FORMAT" + echo "bash ./youtube-dl.sh suche/search URL/stichwort FORMAT" echo "Formate: [opus/m4a/video/hd/fullhd/fullhdmp4/4k/FORMAT]" exit 0 fi -if [ "$1" == "suche" ] || [ "$1" == "nosuche" ]; then +if [ "$1" == "suche" ] || [ "$1" == "search" ]; then suche="$1" url="$2" format="$3" @@ -45,15 +45,17 @@ elif [ -n "$format" ]; then fi video="" -if [ "$suche" == "suche" ] +if [ "$suche" == "suche" ] || [ "$suche" == "search" ] then if ! youtube-dl "ytsearch:$url" -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --no-playlist $format; then echo "Download fehlgeschlagen" + exit 1 fi video=$(youtube-dl "ytsearch:$url" -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --no-playlist --get-filename $format) else if ! youtube-dl -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --no-playlist $format $url; then echo "Download fehlgeschlagen" + exit 1 fi video=$(youtube-dl -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --no-playlist --get-filename $format $url) fi @@ -62,4 +64,5 @@ if [ "${video}" != "" ]; then vlc.exe ${video} else echo "Konnte Video nicht finden" + exit 1 fi diff --git a/youtube.sh b/youtube.sh index 57a5dc7..c0d722a 100755 --- a/youtube.sh +++ b/youtube.sh @@ -5,12 +5,12 @@ set -ex if [ "$1" == "--help" ] || [[ -z "$1" ]] then echo "bitte alles kleinschreiben" - echo "bash ./youtube-dl.sh suche/NOSUCHE URL/SUCHE FORMAT" + echo "bash ./youtube-dl.sh suche/search URL/stichwort FORMAT" echo "Formate: [opus/m4a/video/hd/fullhd/fullhdmp4/4k/FORMAT]" exit 0 fi -if [ "$1" == "suche" ] || [ "$1" == "nosuche" ]; then +if [ "$1" == "suche" ] || [ "$1" == "search" ]; then suche="$1" url="$2" format="$3" @@ -45,15 +45,17 @@ elif [ -n "$format" ]; then fi video="" -if [ "$suche" == "suche" ] +if [ "$suche" == "suche" ] || [ "$suche" == "search" ] then if ! youtube-dl "ytsearch:$url" -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --no-playlist $format; then echo "Download fehlgeschlagen" + exit 1 fi video=$(youtube-dl "ytsearch:$url" -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --no-playlist --get-filename $format) else if ! youtube-dl -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --no-playlist $format $url; then echo "Download fehlgeschlagen" + exit 1 fi video=$(youtube-dl -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --no-playlist --get-filename $format $url) fi @@ -62,4 +64,5 @@ if [ "${video}" != "" ]; then vlc.exe ${video} else echo "Konnte Video nicht finden" + exit 1 fi