DIY: command line interface

Wake up, Neo...

// YOUTUBE DOWNLOAD PRO (YT-DLP)

Ever wanted to download a song or playlist right from youtube and play if offline? Tired of paying Spotify to rent music? Youtube download pro has your back. This guide is for MacOS, please see additional Linux and Winoows instructions here or view the source code

1. Download and add Homebrew to your path

$  /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

$  echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/yourUserNameHere/.zprofile

$  eval "$(/opt/homebrew/bin/brew shellenv)"

2. Install & update youtube download pro as well as ffmpeg (an open-source software project that provides a suite of libraries and programs for handling video, audio, and other multimedia files and streams)

$  brew install ffmpeg yt-dlp

$  brew update

3a. Download an mp3 audio file, ignore hex code extensions, and only download the first song in the playlist (to download songs 2 through 8 we would use "--playlist-start 2 --playlist-end 8")

$  yt-dlp -o "%(title)s.%(ext)s" -f bestaudio --ignore-errors --extract-audio --audio-format mp3 --audio-quality 0 --playlist-end 1 "https://www.youtube.com/watch?v=5bpjhJ01uHI&list=RD5bpjhJ01uHI&start_radio=1"

3b. Download an mp3 playlist

$  yt-dlp -o "%(title)s.%(ext)s" -f bestaudio --ignore-errors --extract-audio --audio-format mp3 --audio-quality 0 "https://www.youtube.com/playlist?list=PL63ZO-jXFTatssIiQjDHSa6X-WPu-EyYV"

3c. Download a video file, in this case an mp4 file and only the first video in the playlist

$  yt-dlp --format "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4]" --playlist-end 1 "https://www.youtube.com/watch?v=5telYPUNxWg"

// WGET

copy any website's code

1. Install and add to home path, restart terminal

$  brew install wget

$  ls -ld .?*

$  touch ~/.zshrc

$  open .zshrc

$  add line >> export PATH=/opt/homebrew/bin:$PATH

$  restart terminal

2. Download a website via wget

$  wget https://credej.github.io