The demo gods can be cruel, it's important that you safeguard yourself from unnecessary risk. This includes not relying on a fast or reliable Internet connection to stream that YouTube video in your presentation. This is why I'm a big fan of the python script "youtube-dl" it makes downloading high quality videos easy and I don't leave my presentations exposed to failure. Also don't let the name 'youtube-dl' fool you it supports most major video streaming sites and you can find a full list of supported sites here.
Step 1: Install youtube-dl
Open Terminal (/Applications/Utilities/Terminal) and paste:
sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
Then make youtube-dl executable:
sudo chmod a+x /usr/local/bin/youtube-dl
Step 2: Download A Video
Before downloading anything please ensure you have permission from the copyright owner. This post is purely for educational purposes and the information in this post should not be used for obtaining content illegally.
To download a video type youtube-dl followed by the video URL for example:
Bonus Tip 1: Select Quality/Format
Youtube-dl automatically downloads the best available format, however you can also list available formats using the --list-formats flag:
youtube-dl --list-formats http://www.youtube.com/watch?v=--smry-8hhs
Then download a specific format using the --format flag followed by the format id.
BONUS TIP 2: Extract Video Audio
With both FFmpeg and FFprobe installed youtube-dl can also extract the audio track of a video.
To extract the 7zip files, download ALZip from the Mac App Store. Once ALZip is installed double-click the ffprobe-VERSION-NUMBER.7z to extract it.
Install FFmpeg and FFprobe by opening Terminal and typing:
sudo mv ~/Downloads/ffmpeg-VERSION-NUMBER/ffmpeg /usr/local/bin/
sudo mv ~/Downloads/ffprobe-VERSION-NUMBER/ffprobe /usr/local/bin/
Lastly relaunch Terminal and try it out:
youtube-dl --extract-audio YOUTUBE_VIDEO_URL
BONUS TIP 3: Updating youtube-dl
The youtube-dl project is very active and is constantly improving. You can update your youtube-dl install with: