Skip to content

Instantly share code, notes, and snippets.

@dotherightthing
Last active July 30, 2020 10:03
Show Gist options
  • Save dotherightthing/b9cd41c4c65860753984dd85ec9045b1 to your computer and use it in GitHub Desktop.
Save dotherightthing/b9cd41c4c65860753984dd85ec9045b1 to your computer and use it in GitHub Desktop.
Youtube DL instructions

Youtube DL

Installation (macOS)

  1. Do a Spotlight search for terminal.app
  2. Then copy and paste the following lines into the Terminal window, pressing ENTER after each command
# cd = change directory
cd /usr/local
# mkdir = make directory
mkdir bin
# curl = download a file from a URL to a hard drive location
sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
# chmod = apply the correct permissions to the downloaded file
sudo chmod a+rx /usr/local/bin/youtube-dl

Troubleshooting

ERROR: ffprobe or avprobe not found. Please install one.

  1. Download the latest snapshot build of FFmpeg as a .zip archive from https://evermeet.cx/ffmpeg/
  2. Extract zip and copy to /usr/local/bin

Cannot install via cUrl due to expired SSL certificate

Download directly from https://yt-dl.org/downloads/latest/youtube-dl and copy and paste to /usr/local/bin then run CHMOD command

Unable to download webpage: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED]

Add --no-check-certificate flag to end of youtube-dl command.

Updating

# check which version you have (useful if you have a problem)
youtube-dl --version
# update to latest version:
sudo youtube-dl -U

Usage

Official instructions

Rip a single

# set output location
# after typing 'cd ' you can drag and drop the destination folder into the window, then press ENTER
cd DIRECTORY_NAME
# output template - replace VIDEO_ID with the string shown after https://www.youtube.com/watch?v=
youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 --embed-thumbnail -o '%(title)s.%(ext)s' https://www.youtube.com/watch?v=VIDEO_ID

Rip a playlist

# set output location
# after typing 'cd ' you can drag and drop the destination folder into the window, then press ENTER
cd DIRECTORY_NAME
# output template - replace PLAYLIST_ID with the string shown after https://www.youtube.com/playlist?list=
youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 --embed-thumbnail -o '%(title)s.%(ext)s' https://www.youtube.com/playlist?list=PLAYLIST_ID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment