Last active
November 23, 2019 12:53
-
-
Save kamladi/5085043 to your computer and use it in GitHub Desktop.
Youtube Video To MP3 File Bash Script (Mac OS X)
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
#! bin/bash | |
#PREREQ's: Install XCode Command Line Tools, Homebrew, and MacPorts | |
brew install wget lame #wget retrieves files via HTTP, lame is an MP3 encoder | |
sudo port install ffmpeg | |
sudo wget http://youtube-dl.org/downloads/2013.02.25/youtube-dl -O /usr/local/bin/youtube-dl | |
sudo chmod a+x /usr/local/bin/youtube-dl #make youtube-dl file executable | |
#make custom bash shortcut. Source: http://alias.sh/youtube-video-mp3-file | |
echo "mp3(){ youtube-dl $1 --extract-audio --title --audio-format mp3 }" >> ~/.bash_profile | |
source ~/.bash_profile | |
echo "Setup complete! To download, run 'mp3 {link}', where {link} is the YouTube Link" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment