From 7ce17d9c6a3f896135d73ea494d9ea2911545cd2 Mon Sep 17 00:00:00 2001 From: CoolnsX Date: Thu, 24 Jun 2021 11:25:49 +0530 Subject: [PATCH] Upload youtube --- youtube.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 youtube.sh diff --git a/youtube.sh b/youtube.sh new file mode 100755 index 0000000..ba2fcb5 --- /dev/null +++ b/youtube.sh @@ -0,0 +1,34 @@ +#!/bin/sh + + +full_video() +{ + video=$1 + printf "$video" + youtube-dl -f best "$video" + +} + +part_video() +{ + video=$1 + printf "Enter Starting Point(hh:mm:ss):" + read start + printf "Enter Duration:" + read dur + ffmpeg -i $(youtube-dl -f best --get-url "$video") -ss $start -t $dur $HOME/Videos/$(date +%s).mp4 +} + +printf "Input Youtube link :" +read x +printf "Download>>\n[f]Full video\n[p]Part of video" +printf "\nEnter choice:" +read choice +case $choice in + f) + full_video "$x";; + p) + part_video "$x";; + q) + break;; +esac