Reference
Setting the yt-dlp Download Location
Control exactly where yt-dlp saves files: set a folder with -P, build filenames and subfolders with -o output templates, and make it permanent in your config.
Updated 2026-06-13
yt-dlp gives you two tools for placement: -P sets the destination folder, and -o defines the filename (and any subfolders). Together they control exactly where every file lands.
Set the output folder with -P
yt-dlp -P "~/Videos" "<URL>"Build filenames with -o output templates
Templates use %(field)s placeholders that yt-dlp fills from the video's metadata:
yt-dlp -o "%(uploader)s/%(title)s [%(id)s].%(ext)s" "<URL>"| Field | Example value |
|---|---|
%(title)s | Never Gonna Give You Up |
%(id)s | dQw4w9WgXcQ |
%(uploader)s | Rick Astley |
%(upload_date)s | 20091025 |
%(playlist_index)s | 03 |
%(ext)s | mp4 |
Combine -P and -o
yt-dlp -P "~/Media" -o "%(uploader)s/%(title)s.%(ext)s" "<URL>"-P sets the base; -o adds structure below it. Subfolders in the template are created automatically.
Make it the default
Move these into your config file so they apply to every run. See also default download location and where does yt-dlp download to.