how to use youtube-dl linux code example

Example 1: install youtube-dl in ubuntu

$ sudo apt-get install youtube-dl

Example 2: youtube-dl ubuntu

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update && sudo apt-get install youtube-dlg

Example 3: youtube dl text tracked playlist download

# Download playlist as mp3, tracking videos which are downloaded:
youtube-dl --download-archive downloaded.txt --no-post-overwrites -ciwx --audio-format mp3 -o "%(title)s.%(ext)s" <url>

# Download playlist as mp4 at highest quality, embedding metadata, thumbnail, subs, tracking videos which are downloaded
youtube-dl --download-archive downloaded.txt --no-post-overwrites -ciw -f bestvideo --merge-output-format mp4 --write-auto-sub --embed-thumbnail --embed-subs --add-metadata -o "%(title)s.%(ext)s" <url>

Example 4: youtube-dl don't replace videos

youtube-dl --download-archive downloaded.txt --no-post-overwrites -ciwx --audio-format mp3 -o "%(title)s.%(ext)s" [path here]