2017-05-18 22:51:33 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-06-06 21:17:36 +02:00
|
|
|
set -ex
|
|
|
|
|
2017-05-18 22:51:33 +02:00
|
|
|
read -p "Wie ist die URL? : " url
|
|
|
|
read -p "Wo sollen die Dateien heruntergeladen werden? : " pfad
|
2017-06-06 21:17:36 +02:00
|
|
|
read -p "Soll ein Video heruntergeladen werden oder Audio? [opus/audio/video/BEST] : " format
|
2017-05-18 22:51:33 +02:00
|
|
|
|
2017-05-31 13:16:28 +02:00
|
|
|
if [ "$format" == "opus" ]
|
2017-05-18 22:51:33 +02:00
|
|
|
then
|
2017-06-06 21:17:36 +02:00
|
|
|
format="-f 251"
|
2017-05-31 13:16:28 +02:00
|
|
|
elif [ "$format" == "audio" ]
|
|
|
|
then
|
2017-06-06 21:17:36 +02:00
|
|
|
format="-f 140"
|
|
|
|
elif [ "$format" == "video" ]
|
|
|
|
then
|
|
|
|
format="-f 43"
|
2017-05-18 22:51:33 +02:00
|
|
|
fi
|
|
|
|
|
2017-05-31 13:16:28 +02:00
|
|
|
mkdir -p $pfad
|
|
|
|
|
2017-05-18 22:51:33 +02:00
|
|
|
cd $pfad
|
2017-06-06 21:17:36 +02:00
|
|
|
youtube-dl -i $format $url
|