Skip to content

Instantly share code, notes, and snippets.

@denislutz
Last active June 3, 2017 23:07
Show Gist options
  • Save denislutz/dba14480f40ef5de9cd3e2a45b91f1bb to your computer and use it in GitHub Desktop.
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
# 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