Bläddra i källkod

Add 'ytdl-s'

master
HMSheets 5 år sedan
förälder
incheckning
db1f4d109d
1 ändrade filer med 123 tillägg och 0 borttagningar
  1. +123
    -0
      ytdl-s

+ 123
- 0
ytdl-s Visa fil

@@ -0,0 +1,123 @@
#!/usr/bin/env bash
# ytdl-s - youtube-dl script
# by HMsheets

link=""

IFS='' read -r -d '' titleVAR <<-'EOF'
-----------------------------------------------
. __ .___.__ .
. ___.__._/ |_ __| _/| | ______ .
. < | |\ __\/ __ | | | ______ / ___/ .
. \___ | | | / /_/ | | |__ /_____/ \___ \ .
. / ____| |__| \____ | |____/ /____ > .
. \/ \/ \/ .
-----------------------------------------------
Version 0.5.0
A bash script for interfacing with youtube-dl
Written by HMSheets
-------------------------------------------------

EOF

title() {
echo "$titleVAR"
}

bestVideoPlusAudio() {
# Best Video and Audio Quality Download
clear
title
bvpaActive=1
while [ $bvpaActive == 1 ]; do
echo "Please provide a link"
read usrlink
link=$usrlink
clear
title
echo "Do you want to also grab any English Subtitles? (y/n)"
read subChoice
clear
title
if [ $subChoice == y ]; then
youtube-dl --write-srt --sub-lang en -f bestvideo+bestaudio $link
elif [ $subChoice == n ]; then
youtube-dl -f bestvideo+bestaudio $link
else
echo ""
echo "ERROR: Selection Does Not Exist."
sleep 1
continue
fi
echo ""
echo "Do you want to download another video? (y/n)"
read anotherv
if [ $anotherv == y ]; then
continue
elif [ $anotherv == n ]; then
bvpaActive=0
fi
done
}

versionSelect() {
clear
title
versionSelectActive=1
while [ $versionSelectActive == 1 ]; do
youtube-dl -F $link
echo ""
echo "Pick a version to Download"
read version
youtube-dl -f $version $link
clear
echo ""
echo "Do you want to download another version? (y/n)"
read anotherv
if [ $anotherv == y ]; then
continue
elif [ $anotherv == n ]; then
versionSelectActive=0
fi
done
}

while true; do
clear
title
echo ""
echo "Welcome to ytdl-s"
echo ""
echo "1 - Download Specific Versions of a Link"
echo "2 - Download Video With Best Video+Best Audio"
echo "3 - Exit"

read choice1

if [ $choice1 == 3 ]; then
clear
exit
elif [[ $choice1 != 1 && $choice1 != 2 ]]; then
echo ""
echo "ERROR: Selection Does Not Exist. Restarting Script!"
sleep 3
continue
fi

if [ $choice1 == 1 ]; then
echo "Please provide a link"
read usrlink
link=$usrlink
versionSelect
clear
link=""
elif [ $choice1 == 2 ]; then
bestVideoPlusAudio
clear
link=""
else
echo ""
echo"ERROR: Problem Reading Your Selection. Restarting Script!"
sleep 3
fi
done

Laddar…
Avbryt
Spara