Download YouTube Video, Playlist in High Quality

Download YouTube videos/playlists in 720p–4K using yt-dlp. Thanks for reading! Join my newsletter & drop your thoughts in the comments.

Download YouTube Video, Playlist in High Quality
Photo by Szabo Viktor / Unsplash

In this article, I will share how you can download YouTube videos and playlists in high quality, like 4k, 2k, for free. To download the videos, I am using the CLI tool called yt-dlp, which is an Open-Source, feature-rich command line tool to download YouTube videos.

Github

yt-dlp
yt-dlp

Step 1: Installation

I'm using macOS for this tutorial, but the process for downloading and installing the tool is very simple for other operating systems, such as Linux or Windows. You can check out the installation guide here - https://github.com/yt-dlp/yt-dlp?tab=readme-ov-file#installation

For macOS, I have used the brew package installer to download the yt-dlp

brew install yt-dlp

download yt-dlp

For Linux, you can use the following curl command -

sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp
sudo chmod a+rx /usr/local/bin/yt-dlp

Step 2: Start Using

After the successful installation, we can start using the tool by simply typing the command like -

yt-dlp https://www.youtube.com/watch?v=VIDEO_ID
💡
Replace VIDEO_ID with the actual video ID or full URL.

Download best quality video + audio merged

yt-dlp -f "bv*+ba/b" https://www.youtube.com/watch?v=VIDEO_ID

Download as MP3

yt-dlp -x --audio-format mp3 https://www.youtube.com/watch?v=VIDEO_ID

Set output filename or folder

yt-dlp -o "~/Downloads/%(title)s.%(ext)s" https://www.youtube.com/watch?v=VIDEO_ID

Step 3: Make it Easy

Think we want to download the video with following choses -

  • 1080p quality
  • Audio + Video merged
  • Output to a folder
  • Download whole playlist
  • etc.

In that case we have to use very long command, and it very inconvenient to remember all this.

yt-dlp -f "bestvideo[height=720]+bestaudio/best[height=720]" -o "/your/target/path/%(title)s.%(ext)s" https://www.youtube.com/watch?v=VIDEO_ID

There I have came up with an idea to create a bashrc script and start using it in very convenient way like

ytdl 1080 VIDEO_ID

To start using it, we have to install ffmpeg package first -

brew install ffmpeg

then edit ~/.bashrc (Linux) or ~/.zshrc (MAC) -

nano ~/.zshrc

and add the following code (tested on mac)

ytdl() {
  # Default resolution
  RES="720"
  IS_PLAYLIST=false

  # Parse arguments
  if [[ "$1" == "-p" ]]; then
    IS_PLAYLIST=true
    VIDEO_ID="$2"
  elif [[ "$2" == "-p" ]]; then
    IS_PLAYLIST=true
    RES="$1"
    VIDEO_ID="$3"
  elif [[ "$1" =~ ^[0-9]+$ ]]; then
    RES="$1"
    VIDEO_ID="$2"
  else
    VIDEO_ID="$1"
  fi

  if [[ -z "$VIDEO_ID" ]]; then
    echo "❌ Missing video or playlist ID"
    echo "Usage:"
    echo "  ytdl 720 VIDEO_ID"
    echo "  ytdl VIDEO_ID         # defaults to 720"
    echo "  ytdl 2160 -p PLAYLIST_ID"
    return 1
  fi

  # Validate resolution
  if [[ ! "$RES" =~ ^(720|1080|1440|2160)$ ]]; then
    echo "❌ Invalid resolution: $RES"
    echo "Allowed: 720, 1080, 1440 (2K), 2160 (4K)"
    return 1
  fi

  # Output path
  OUTPUT_DIR="/Downloads/youtube"

  # Playlist
  if $IS_PLAYLIST; then
    URL="https://www.youtube.com/playlist?list=${VIDEO_ID}"
    OUT_TMPL="${OUTPUT_DIR}/%(title)s-${RES}.%(ext)s"
    yt-dlp -f "bestvideo[height=${RES}]+bestaudio/best[height=${RES}]" \
      --merge-output-format mp4 \
      -o "$OUT_TMPL" "$URL"
    return $?
  fi

  # Single video mode
  URL="https://www.youtube.com/watch?v=${VIDEO_ID}"

  # Get title and sanitize
  TITLE=$(yt-dlp --get-title "$URL" 2>/dev/null)
  if [[ -z "$TITLE" ]]; then
    echo "❌ Failed to fetch video title. Invalid video ID?"
    return 1
  fi
  SAFE_TITLE=$(echo "$TITLE" | tr '/:*?"<>|' '_' | sed 's/ /_/g')
  FILE_PATH="${OUTPUT_DIR}/${SAFE_TITLE}-${RES}.mp4"

  # Skip if file already exists
  if [[ -f "$FILE_PATH" ]]; then
    echo "✅ Skipping: Already exists -> $FILE_PATH"
    return 0
  fi

  # Download
  yt-dlp -f "bestvideo[height=${RES}]+bestaudio/best[height=${RES}]" \
    --merge-output-format mp4 \
    -o "$FILE_PATH" "$URL"
}

Now, change the source for your terminal by running source ~./zshrc or reopen the terminal.

This script supports

  • 720, 1080, 1440, 2160 (up to 4K)
  • Playlist downloads with -p
  • Filename: title-resolution.mp4
  • Skips download if file exists
  • Compatible with Zsh and safe from path/quote issues

Step 4: Start Downloading

After the all these steps, your are now able to download videos using the following commands -

ytdl W0fBrAkELNU                 # Downloads in 720p
ytdl 1080 W0fBrAkELNU            # Downloads in 1080p
ytdl 1440 W0fBrAkELNU            # Downloads in 2K
ytdl 2160 W0fBrAkELNU            # Downloads in 4K

ytdl 1080 -p PLAYLIST_ID         # Downloads full playlist in 1080p

🙏 Thanks for Reading

I hope this guide helped you understand how to download YouTube videos and playlists in high resolution using yt-dlp. Whether you’re saving tutorials, music, or full playlists in 720p, 1080p, 2K, or 4K—this method should work reliably on any platform.

If you found this useful, consider joining my newsletter to get more practical how-to guides, tools, and updates delivered straight to your inbox.

Have questions, tips, or facing any issues? Drop a comment below—I’d love to hear your thoughts or help you out.