Skip to content

Instantly share code, notes, and snippets.

@moaj257
Last active March 8, 2024 01:29
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save moaj257/fa0430478d50ae703950b84f9d246a91 to your computer and use it in GitHub Desktop.
Save moaj257/fa0430478d50ae703950b84f9d246a91 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
@vadimpusc
Copy link

Where is it saving files? I can't find it

@adriancmiranda
Copy link

@vadimpusc

run one of these commands:

whereis youtube-dl
which youtube-dl
type youtube-dl

to found out

@engagepy
Copy link

It is exceptionally slow though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment