This commit is contained in:
CoolnsX
2021-06-24 20:19:44 +05:30
parent b880852ed6
commit 5a470fa3ca

19
youtube
View File

@@ -1,10 +1,17 @@
#!/bin/sh #!/bin/sh
c_red="\033[1;31m"
c_green="\033[1;32m"
c_yellow="\033[1;33m"
c_blue="\033[1;34m"
c_magenta="\033[1;35m"
c_cyan="\033[1;36m"
c_reset="\033[0m"
full_video() full_video()
{ {
video=$1 video=$1
printf "$video"
youtube-dl -f best "$video" youtube-dl -f best "$video"
} }
@@ -12,17 +19,17 @@ full_video()
part_video() part_video()
{ {
video=$1 video=$1
printf "Enter Starting Point(hh:mm:ss):" printf "${c_magenta}Enter Starting Point(hh:mm:ss)or(mm:ss)${c_reset}:"
read start read start
printf "Enter Duration:" printf "${c_yellow}Enter Duration(seconds):${c_cyan}"
read dur read dur
ffmpeg -i $(youtube-dl -f best --get-url "$video") -ss $start -t $dur $HOME/Videos/$(date +%s).mp4 ffmpeg -i $(youtube-dl -f best --get-url "$video") -ss $start -t $dur $HOME/Videos/$(date +%s).mp4
} }
printf "Input Youtube link :" printf "${c_blue}Input Youtube link :${c_magenta}"
read x read x
printf "Download>>\n[f]Full video\n[p]Part of video" printf "${c_yellow}Download>>\n${c_green}[f]Full video\n${c_cyan}[p]Part of video\n${c_red}[q]Quit"
printf "\nEnter choice:" printf "\n${c_reset}Enter choice:${c_green}"
read choice read choice
case $choice in case $choice in
f) f)