add VLC youtube Scripts
This commit is contained in:
parent
67e3f8930b
commit
8f956295c8
4 changed files with 202 additions and 7 deletions
56
youtube-mplayer.sh
Normal file
56
youtube-mplayer.sh
Normal file
|
@ -0,0 +1,56 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$1" == "--help" ] || [[ -z "$1" ]]
|
||||
then
|
||||
echo "bitte alles kleinschreiben"
|
||||
echo "bash ./youtube-dl.sh suche/NOSUCHE URL/SUCHE FORMAT"
|
||||
echo "Formate: [opus/m4a/video/hd/fullhd/fullhdmp4/4k/FORMAT]"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$1" == "suche" ] || [ "$1" == "nosuche" ]; then
|
||||
suche="$1"
|
||||
url="$2"
|
||||
format="$3"
|
||||
else
|
||||
url="$1"
|
||||
format="$2"
|
||||
fi
|
||||
|
||||
#read -p "Wie ist die URL/suche? : " 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" == "fullhdmp4" ]
|
||||
then
|
||||
format="-f 299+140" ]
|
||||
elif [ "$format" == "4k" ]
|
||||
then
|
||||
format="-f 315+251"
|
||||
elif [ -n "$format" ]; then
|
||||
format="-f $format"
|
||||
fi
|
||||
|
||||
if [ "$suche" == "suche" ]
|
||||
then
|
||||
youtube-dl "ytsearch:$url" -q --force-ipv4 $format -o- | mplayer -fs -cache 8192 -
|
||||
else
|
||||
youtube-dl -q --force-ipv4 $format -o- $url | mplayer -fs -cache 8192 -
|
||||
fi
|
65
youtube-vlc.sh
Normal file
65
youtube-vlc.sh
Normal file
|
@ -0,0 +1,65 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -ex
|
||||
|
||||
if [ "$1" == "--help" ] || [[ -z "$1" ]]
|
||||
then
|
||||
echo "bitte alles kleinschreiben"
|
||||
echo "bash ./youtube-dl.sh suche/NOSUCHE URL/SUCHE FORMAT"
|
||||
echo "Formate: [opus/m4a/video/hd/fullhd/fullhdmp4/4k/FORMAT]"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$1" == "suche" ] || [ "$1" == "nosuche" ]; then
|
||||
suche="$1"
|
||||
url="$2"
|
||||
format="$3"
|
||||
else
|
||||
url="$1"
|
||||
format="$2"
|
||||
fi
|
||||
|
||||
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" == "fullhdmp4" ]
|
||||
then
|
||||
format="-f 299+140" ]
|
||||
elif [ "$format" == "4k" ]
|
||||
then
|
||||
format="-f 315+251"
|
||||
elif [ -n "$format" ]; then
|
||||
format="-f $format"
|
||||
fi
|
||||
|
||||
video=""
|
||||
if [ "$suche" == "suche" ]
|
||||
then
|
||||
if ! youtube-dl "ytsearch:$url" -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --no-playlist $format $url; then
|
||||
echo "Download fehlgeschlagen"
|
||||
fi
|
||||
video=$(youtube-dl "ytsearch:$url" -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --no-playlist --get-filename $format $url)
|
||||
else
|
||||
if ! youtube-dl -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --no-playlist $format $url; then
|
||||
echo "Download fehlgeschlagen"
|
||||
fi
|
||||
video=$(youtube-dl -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --no-playlist --get-filename $format $url)
|
||||
fi
|
||||
|
||||
if [ "${video}" != "" ]; then
|
||||
vlc ${video}
|
||||
else
|
||||
echo "Konnte Video nicht finden"
|
||||
fi
|
65
youtube-vlc_windows.sh
Normal file
65
youtube-vlc_windows.sh
Normal file
|
@ -0,0 +1,65 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -ex
|
||||
|
||||
if [ "$1" == "--help" ] || [[ -z "$1" ]]
|
||||
then
|
||||
echo "bitte alles kleinschreiben"
|
||||
echo "bash ./youtube-dl.sh suche/NOSUCHE URL/SUCHE FORMAT"
|
||||
echo "Formate: [opus/m4a/video/hd/fullhd/fullhdmp4/4k/FORMAT]"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$1" == "suche" ] || [ "$1" == "nosuche" ]; then
|
||||
suche="$1"
|
||||
url="$2"
|
||||
format="$3"
|
||||
else
|
||||
url="$1"
|
||||
format="$2"
|
||||
fi
|
||||
|
||||
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" == "fullhdmp4" ]
|
||||
then
|
||||
format="-f 299+140" ]
|
||||
elif [ "$format" == "4k" ]
|
||||
then
|
||||
format="-f 315+251"
|
||||
elif [ -n "$format" ]; then
|
||||
format="-f $format"
|
||||
fi
|
||||
|
||||
video=""
|
||||
if [ "$suche" == "suche" ]
|
||||
then
|
||||
if ! youtube-dl "ytsearch:$url" -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --no-playlist $format $url; then
|
||||
echo "Download fehlgeschlagen"
|
||||
fi
|
||||
video=$(youtube-dl "ytsearch:$url" -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --no-playlist --get-filename $format $url)
|
||||
else
|
||||
if ! youtube-dl -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --no-playlist $format $url; then
|
||||
echo "Download fehlgeschlagen"
|
||||
fi
|
||||
video=$(youtube-dl -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --no-playlist --get-filename $format $url)
|
||||
fi
|
||||
|
||||
if [ "${video}" != "" ]; then
|
||||
vlc.exe ${video}
|
||||
else
|
||||
echo "Konnte Video nicht finden"
|
||||
fi
|
23
youtube.sh
23
youtube.sh
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -ex
|
||||
|
||||
if [ "$1" == "--help" ] || [[ -z "$1" ]]
|
||||
then
|
||||
|
@ -19,10 +19,6 @@ else
|
|||
format="$2"
|
||||
fi
|
||||
|
||||
#read -p "Wie ist die URL/suche? : " 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"
|
||||
|
@ -48,9 +44,22 @@ elif [ -n "$format" ]; then
|
|||
format="-f $format"
|
||||
fi
|
||||
|
||||
video=""
|
||||
if [ "$suche" == "suche" ]
|
||||
then
|
||||
youtube-dl "ytsearch:$url" -q --force-ipv4 $format -o- | mplayer -fs -cache 8192 -
|
||||
if ! youtube-dl "ytsearch:$url" -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --no-playlist $format $url; then
|
||||
echo "Download fehlgeschlagen"
|
||||
fi
|
||||
video=$(youtube-dl "ytsearch:$url" -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --no-playlist --get-filename $format $url)
|
||||
else
|
||||
youtube-dl -q --force-ipv4 $format -o- $url | mplayer -fs -cache 8192 -
|
||||
if ! youtube-dl -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --no-playlist $format $url; then
|
||||
echo "Download fehlgeschlagen"
|
||||
fi
|
||||
video=$(youtube-dl -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --no-playlist --get-filename $format $url)
|
||||
fi
|
||||
|
||||
if [ "${video}" != "" ]; then
|
||||
vlc.exe ${video}
|
||||
else
|
||||
echo "Konnte Video nicht finden"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue