Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brayoh/aea3c37fa9fcd2d366ded724e5e51b60 to your computer and use it in GitHub Desktop.
Save brayoh/aea3c37fa9fcd2d366ded724e5e51b60 to your computer and use it in GitHub Desktop.
Download youtube videos via mac terminal
  1. Open terminal.
  2. Use any one of following to install youtube-dl (A downloader written in python).
    • Fire these 2 command if you have curl installed.
    sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl 
    sudo chmod a+rx /usr/local/bin/youtube-dl
    
    • Fire these 2 commands
    sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
    sudo chmod a+rx /usr/local/bin/youtube-dl
    
    • Fire this command if you have homebrew installed
    brew install youtube-dl
    
  3. To download a youtube playlist, use the following command.
    youtube-dl -o '%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' PLAYLIST_LINK
    
    • Example
    youtube-dl -o '%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re
    
  4. To Download all playlists of a youtube channel, use the following command.
    youtube-dl -o '%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' LINK_TO_CHANNEL_PLAYLISTS
    
    • Example
    youtube-dl -o '%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' https://www.youtube.com/user/TheLinuxFoundation/playlists
    
For more info visit rg3/youtube-dl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment