Command guide
How to download playlists with yt-dlp
Playlist downloads are easy to start and easy to let turn into a mess. The real goal is not just downloading every item. It is getting the whole playlist cleanly, without duplicate files, broken naming, or chaos when you rerun it.
Quick answer
yt-dlp "PLAYLIST_URL"That downloads the playlist using yt-dlp defaults. It is the right starting point before you add extra workflow flags.
Download only part of a playlist
yt-dlp --playlist-start 5 --playlist-end 12 "PLAYLIST_URL"Use this when you want a range instead of the full list. This is useful for testing before you commit to a very large playlist.
Pick exactly the items you want
yt-dlp -I 1,3,5-8 "PLAYLIST_URL"-I (--playlist-items) is the modern, more flexible version of the start/end range. It takes a comma-separated list of positions and ranges, so 1,3,5-8 grabs items 1, 3, and 5 through 8. You can also use a slice with a step - -I ::2 takes every other item, and -I -5: takes the last five. Negative numbers count from the end of the list.
Keep playlist downloads organized
yt-dlp -o "%(playlist_title)s/%(playlist_index)s - %(title)s.%(ext)s" "PLAYLIST_URL"This is where playlist downloads stop feeling random. Good output templates save a lot of cleanup later.
Download a playlist as audio (MP3)
yt-dlp -x --audio-format mp3 \
-o "%(playlist_title)s/%(playlist_index)s - %(title)s.%(ext)s" \
"PLAYLIST_URL"-x (--extract-audio) throws away the video and keeps the audio, and --audio-format mp3 converts each item to MP3. This needs ffmpeg installed - without it yt-dlp can download the audio but cannot convert it. The same output template keeps the files numbered and in one folder, so the playlist order is preserved in your music player.
Download a whole channel
yt-dlp -o "%(channel)s/%(upload_date)s - %(title)s.%(ext)s" \
"https://www.youtube.com/@CHANNEL/videos"A channel is just a playlist to yt-dlp. Point it at the channel's /videos tab (or /streams or /shorts) and it walks every upload. Dropping %(upload_date)s into the template sorts files chronologically. For a large channel, combine this with the archive file below so a stopped run picks up where it left off instead of starting over.
The real playlist pain point: reruns
The first run is easy. The second and third runs are where people get duplicate files and messy folders. If you are downloading an evolving playlist repeatedly, the fix is an archive file plus predictable naming, covered next.
Download only new items on a rerun
yt-dlp --download-archive archive.txt \
-o "%(playlist_title)s/%(playlist_index)s - %(title)s.%(ext)s" \
"PLAYLIST_URL"--download-archive writes the ID of every item it finishes into archive.txt. Run the same command again later and yt-dlp prints "has already been recorded in the archive" for everything you already have and downloads only the new uploads. Keep the archive file next to your downloads and reuse the exact command - that is what turns a one-off grab into something you can safely repeat.
Keep a playlist in sync (cron-friendly)
yt-dlp -i --download-archive archive.txt --no-overwrites \
-o "%(playlist_title)s/%(playlist_index)s - %(title)s.%(ext)s" \
"PLAYLIST_URL"This is the one-liner to drop in a cron job or scheduled task. -i (--ignore-errors) stops a single private, deleted or region-blocked item from aborting the whole run, --no-overwrites leaves existing files alone, and the archive means each run only fetches what is actually new. The folder then tracks the playlist with no duplicates and no manual cleanup. Running it unattended on a server is its own job, from keeping yt-dlp current to getting past the blocks datacenter IPs hit; running yt-dlp on a server covers that setup.
If the sync is part of an app that runs on a server, such as a clip tool or a search index that follows a channel, there's a Python script that imports each new channel video on a schedule through an API instead: run it from cron every 10 to 20 minutes and it sends each new upload once, with a cost cap per video.
Most common playlist mistakes
- downloading into a flat folder with no structure
- rerunning the command with no duplicate-management strategy
- testing on a huge playlist before checking naming/output first
- assuming private playlist items will work without cookies or auth
Practical recommendation
If the playlist is large, do one test pass first with a short range and your final output template. That saves a lot of cleanup if your naming or folder structure is wrong.
Automation
Running this on a schedule? See the API version.
Paste a link and watch one API call do what your batch script does — extraction, retries, and site breakage handled.
Building this into an app? See the API your backend calls instead
Frequently asked questions
How do I download a whole playlist with yt-dlp?
Pass the playlist URL: `yt-dlp "PLAYLIST_URL"` downloads every item with yt-dlp's defaults. Add an output template like `-o "%(playlist_title)s/%(playlist_index)s - %(title)s.%(ext)s"` so the files land numbered and in one folder instead of a flat mess.
How do I download only certain videos from a playlist?
Use `-I` (`--playlist-items`) with positions and ranges: `-I 1,3,5-8` grabs items 1, 3 and 5 through 8. A slice works too - `-I ::2` takes every other item and `-I -5:` the last five, with negative numbers counting from the end. For a simple range you can also use `--playlist-start` and `--playlist-end`.
Why does yt-dlp download the whole playlist when I only want one video?
A YouTube watch link often carries a `&list=...` parameter, and yt-dlp treats that as a playlist. Add `--no-playlist` to download just the single video the URL points at, or strip everything from `&list=` onward in the URL.
How do I download a YouTube playlist as MP3?
Add `-x --audio-format mp3` and keep the output template: `yt-dlp -x --audio-format mp3 -o "%(playlist_title)s/%(playlist_index)s - %(title)s.%(ext)s" "PLAYLIST_URL"`. This needs [ffmpeg installed](/guides/fix-ffmpeg-not-found); the numbering keeps the playlist order in your music player.
How do I download only new videos from a playlist on a rerun?
Use `--download-archive archive.txt`. yt-dlp records the ID of every finished item, so running the same command again skips what you already have and fetches only new uploads. For a scheduled sync add `-i --no-overwrites` so one private or deleted item doesn't abort the run.
Can yt-dlp download a private or members-only playlist?
Only with the right session. Pass your logged-in cookies (see [using cookies with yt-dlp](/guides/yt-dlp-cookies)); without them, private and members-only items fail even though the public ones in the same playlist download fine.