This commit is contained in:
CoolnsX
2021-08-31 20:23:42 +05:30
parent ceb4f1194c
commit 10eb23741a

View File

@@ -14,9 +14,7 @@ c_reset="\033[0m"
#function to download full video #function to download full video
full_video() full_video()
{ {
video=$1 youtube-dl -f best "$1"
youtube-dl -f best "$video"
} }
# function to download part of a video and also split it for SNS... # function to download part of a video and also split it for SNS...
@@ -29,15 +27,15 @@ part_video()
read dur read dur
printf "Do you want to split video for SNS?? (y or n) :" printf "Do you want to split video for SNS?? (y or n) :"
read x read x
printf "\n\n"
if [ $x == 'n' ]; then if [ $x == 'n' ]; then
ffmpeg -i $(youtube-dl -f best --get-url "$video") -ss $start -t $dur $HOME/Videos/$(date +%T_%F).mp4 ffmpeg -i $(youtube-dl -f best --get-url "$video") -ss $start -t $dur $HOME/Videos/$(date +%T_%F).mp4
else else
out=$(date +%T_%F) out=$(date +%T_%F)
ffmpeg -i $(youtube-dl -f best --get-url "$video") -map 0 -codec copy -f segment -segment_time 30 -ss $start -t $dur $HOME/Videos/${out}_%03d.mp4 ffmpeg -i $(youtube-dl -f best --get-url "$video") -map 0 -codec copy -f segment -segment_time 30 -ss $start -t $dur $HOME/Videos/${out}_%02d.mp4
fi fi
} }
#program starts from here.. #program starts from here..
printf "${c_blue}Input Youtube link :${c_magenta}" printf "${c_blue}Input Youtube link :${c_magenta}"