Youtube-dl Debian download Youtube videos to MP4 MP3

apt-get update -y && apt-get upgrade -y

apt-get install curl -y

curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl

If you do not have curl, you can alternatively use a recent wget:

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

UPDATE Youtube-dl

youtube-dl -U

apt-get install software-properties-common -y

apt-get install ffmpeg -y

Create Symbolic Links python3 to python to recognize youtube-dl

ln -s /usr/bin/python3 /usr/local/bin/python

DOWNLOAD ONLY AUDIO MP3

youtube-dl –extract-audio –audio-format mp3 –format ‘bestaudio’ URL

DOWNLOAD NORMAL MP4

youtube-dl URL

DOWNLOAD HIGH RES MP4

youtube-dl -f ‘bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best’ URL

Source : https://ytdl-org.github.io/youtube-dl/index.html