Last active
June 3, 2017 23:07
-
-
Save denislutz/dba14480f40ef5de9cd3e2a45b91f1bb to your computer and use it in GitHub Desktop.
Bash Script to convert any youtube video to a podcast, video or music
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install youtube-dl https://rg3.github.io/youtube-dl/download.html | |
# place this into your ~/.bash_profile | |
# use just with calling: | |
# conPod https://someyoutubeurl | |
# conPodTo https://someyoutubeurl subfolder_of_podcasts_folder | |
# conVid https://someyoutubeurl | |
# conMus https://someyoutubeurl | |
function convYou2MP3 { | |
cd $1 | |
youtube-dl $2 --extract-audio --audio-format mp3 --audio-quality 0 | |
} | |
function convYou2MP4 { | |
cd $1 | |
youtube-dl $2 -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' | |
} | |
function conMus { | |
convYou2MP3 '/your_path_to_dropbox/Dropbox/Sync/Music' $1 | |
} | |
function conPod { | |
convYou2MP3 '/your_path_to_dropbox/Dropbox/Sync/Podcasts/' $1 | |
} | |
function conPodTo { | |
convYou2MP3 "/your_path_to_dropbox/Dropbox/Sync/Podcasts/$2" $1 | |
} | |
function conVid { | |
convYou2MP4 '/your_path_to_dropbox/Dropbox/Sync/Videos' $1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment