shell-scripte-code/youtube-dl-android.sh

32 lines
776 B
Bash
Raw Normal View History

2017-05-31 13:12:29 +02:00
read -p "Wie ist die URL? : " url
read -p "Wo sollen die Dateien heruntergeladen werden? : " pfad
2017-06-23 20:01:57 +02:00
read -p "Soll ein Video heruntergeladen werden oder Audio? [opus/audio/video/BEST] : " format
2017-05-31 13:12:29 +02:00
if [ "$format" == "opus" ]
then
2017-06-23 20:01:57 +02:00
format="-f 251"
2017-05-31 13:12:29 +02:00
elif [ "$format" == "audio" ]
then
2017-06-23 20:01:57 +02:00
format="-f 140"
elif [ "$format" == "video" ]
then
format="-f 43"
2017-05-31 13:12:29 +02:00
fi
mkdir -p $pfad
2017-06-23 20:01:57 +02:00
2017-05-31 13:12:29 +02:00
cd $pfad
2017-06-23 20:01:57 +02:00
/data/data/com.termux/files/usr/bin/python /storage/emulated/0/youtube-dl --ffmpeg-location /data/data/com.termux/files/usr/bin/ffmpeg -i $format $url
2017-05-31 13:12:29 +02:00
# ROOT_SHELL="$PREFIX/bin/bash"
# ROOT_HOME=$HOME/.suroot
# mkdir -p .suroot
# su --preserve-environment -c "LD_LIBRARY_PATH=$PREFIX/lib HOME=$ROOT_HOME $ROOT_SHELL"
# cd /storage/emulated/0/
# /system/xbin/bash ./youtube-dl-android.sh