{"id":7992,"date":"2026-03-07T18:34:43","date_gmt":"2026-03-07T18:34:43","guid":{"rendered":"https:\/\/commandlinux.com\/?p=7992"},"modified":"2026-03-27T10:57:39","modified_gmt":"2026-03-27T10:57:39","slug":"yt-dlp","status":"publish","type":"post","link":"https:\/\/commandlinux.com\/arch-linux\/yt-dlp\/","title":{"rendered":"The yt-dlp Manual: Grab Videos and Audio From Your Terminal"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n<link rel=\"preconnect\" href=\"https:\/\/fonts.googleapis.com\">\n<link rel=\"preconnect\" href=\"https:\/\/fonts.gstatic.com\" crossorigin>\n<link href=\"https:\/\/fonts.googleapis.com\/css2?family=Lora:ital,wght@0,400;0,600;1,400&#038;family=JetBrains+Mono:wght@400;500&#038;family=DM+Sans:wght@400;500;600&#038;display=swap\" rel=\"stylesheet\">\n<style>\n  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }\n\n  a { color: #1a56db; text-decoration: none; }\n  a:hover { text-decoration: underline; }\n\n  \/* Code *\/\n  code {\n    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;\n    font-size: 0.855rem;\n    background: #f4f4f4;\n    border: 1px solid #e0e0e0;\n    border-radius: 3px;\n    padding: 0.1em 0.4em;\n    color: #c7254e;\n  }\n\n  pre {\n    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;\n    font-size: 0.84rem;\n    background: #f6f6f6;\n    border: 1px solid #e0e0e0;\n    border-radius: 5px;\n    padding: 1rem 1.2rem;\n    overflow-x: auto;\n    margin: 0.8rem 0 1.2rem;\n    line-height: 1.55;\n    color: #1a1a1a;\n  }\n\n  pre code {\n    background: none;\n    border: none;\n    padding: 0;\n    color: inherit;\n    font-size: inherit;\n  }\n\n  \/* Callout boxes *\/\n  .note, .warning, .tip {\n    border-radius: 5px;\n    padding: 0.85rem 1.1rem;\n    margin: 1.2rem 0;\n    font-size: 0.93rem;\n    line-height: 1.65;\n  }\n\n  .note {\n    background: #eff6ff;\n    border-left: 4px solid #3b82f6;\n  }\n\n  .warning {\n    background: #fff5f5;\n    border-left: 4px solid #ef4444;\n  }\n\n  .tip {\n    background: #f0fdf4;\n    border-left: 4px solid #22c55e;\n  }\n\n  .note strong, .warning strong, .tip strong {\n    font-weight: 600;\n    display: inline;\n  }\n\n  \/* Tables *\/\n  table {\n    width: 100%;\n    border-collapse: collapse;\n    margin: 1rem 0 1.4rem;\n    font-size: 0.875rem;\n  }\n\n  th {\n    background: #f0f0f0;\n    text-align: left;\n    padding: 0.6rem 0.85rem;\n    font-weight: 600;\n    border: 1px solid #ddd;\n    font-family: 'DM Sans', sans-serif;\n  }\n\n  td {\n    padding: 0.55rem 0.85rem;\n    border: 1px solid #ddd;\n    vertical-align: top;\n  }\n\n  td:first-child {\n    font-family: 'JetBrains Mono', monospace;\n    font-size: 0.8rem;\n    white-space: nowrap;\n    color: #1a1a1a;\n  }\n\n  tr:nth-child(even) td { background: #fafafa; }\n\n  \/* FAQ accordion *\/\n  .faq-section { margin-top: 2.8rem; }\n\n  .faq-item {\n    border-bottom: 1px solid #e8e8e8;\n  }\n\n  .faq-item input[type=\"checkbox\"] {\n    display: none;\n  }\n\n  .faq-item label {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    cursor: pointer;\n    padding: 1rem 0.25rem;\n    user-select: none;\n  }\n\n  .faq-item label h3 {\n    font-size: 0.98rem;\n    font-weight: 600;\n    color: #1a1a1a;\n    margin: 0;\n    line-height: 1.4;\n    flex: 1;\n  }\n\n  .faq-item label::after {\n    content: '+';\n    font-size: 1.4rem;\n    font-weight: 300;\n    color: #666;\n    margin-left: 1rem;\n    flex-shrink: 0;\n    transition: transform 0.2s ease;\n    line-height: 1;\n  }\n\n  .faq-item input:checked ~ label::after {\n    content: '\u2212';\n  }\n\n  .faq-answer {\n    max-height: 0;\n    overflow: hidden;\n    transition: max-height 0.3s ease, padding 0.3s ease;\n    padding: 0 0.25rem;\n  }\n\n  .faq-item input:checked ~ .faq-answer {\n    max-height: 300px;\n    padding-bottom: 1rem;\n  }\n\n  .faq-answer p {\n    margin-bottom: 0;\n    font-size: 0.93rem;\n    color: #333;\n    line-height: 1.65;\n  }\n\n  ul {\n    padding-left: 1.4rem;\n    margin-bottom: 1rem;\n  }\n\n  li { margin-bottom: 0.3rem; }\n<\/style>\n<\/head>\n<body>\n\n<p>yt-dlp is a command-line tool that downloads videos and audio from YouTube, Vimeo, Dailymotion, and over a thousand other platforms. It handles format selection, subtitle embedding, audio extraction, metadata tagging, cookie-based authentication, and live stream recording. This page covers the most common yt-dlp commands, organized by task.<\/p>\n\n<div class=\"note\">\n  <strong>Note:<\/strong> FFmpeg must be installed for stream merging, audio extraction, and any re-encoding. Run <code>ffmpeg -version<\/code> to verify it is available before using format or audio flags.\n<\/div>\n\n<h2>Download Videos With yt-dlp<\/h2>\n\n<h3>Single video<\/h3>\n\n<p>Pass a URL to grab the highest available quality. yt-dlp fetches the best video and audio streams, then merges them into one file:<\/p>\n\n<pre><code>$ yt-dlp https:\/\/www.example.com\/watch?v=VIDEO_ID<\/code><\/pre>\n\n<h3>Full playlist<\/h3>\n\n<p>Prefix each file with its position number using a naming template:<\/p>\n\n<pre><code>$ yt-dlp -o \"%(playlist_index)s - %(title)s.%(ext)s\" \\\n    \"https:\/\/www.example.com\/playlist?list=PLAYLIST_ID\"<\/code><\/pre>\n\n<h3>Multiple URLs from a text file<\/h3>\n\n<p>Put one URL per line in a plain text file, then pass it with <code>-a<\/code>:<\/p>\n\n<pre><code>$ yt-dlp -a urls.txt<\/code><\/pre>\n\n<h3>Skip already-downloaded files<\/h3>\n\n<p>yt-dlp logs completed video IDs into an archive file and skips them on the next run:<\/p>\n\n<pre><code>$ yt-dlp --download-archive archive.txt --no-overwrites \"PLAYLIST_URL\"<\/code><\/pre>\n\n<h3>Prevent downloading an entire playlist from a short<\/h3>\n\n<pre><code>$ yt-dlp --no-playlist \"SHORTS_URL\"<\/code><\/pre>\n\n<h3>Record a live stream<\/h3>\n\n<p>Use MPEG-TS for HLS streams so the file stays usable if the process is interrupted:<\/p>\n\n<pre><code>$ yt-dlp --hls-use-mpegts \"LIVE_STREAM_URL\"<\/code><\/pre>\n\n<h2>Extract Audio With yt-dlp<\/h2>\n\n<h3>Rip audio and convert to MP3<\/h3>\n\n<pre><code>$ yt-dlp -x --audio-format mp3 \"URL\"<\/code><\/pre>\n\n<h3>Keep the original audio codec without re-encoding<\/h3>\n\n<pre><code>$ yt-dlp -x --audio-format best --no-keep-video \"URL\"<\/code><\/pre>\n\n<h2>Download Subtitles With yt-dlp<\/h2>\n\n<h3>Fetch and embed English captions<\/h3>\n\n<pre><code>$ yt-dlp --write-subs --sub-lang en --embed-subs \"URL\"<\/code><\/pre>\n\n<h3>Split video by chapters<\/h3>\n\n<p>Each chapter marker in the video becomes a separate output file:<\/p>\n\n<pre><code>$ yt-dlp --split-chapters -o \"%(title)s - %(chapter)s.%(ext)s\" \"URL\"<\/code><\/pre>\n\n<h2>Select Format and Quality in yt-dlp<\/h2>\n\n<p>Use <code>-F<\/code> to list all available formats for a URL before downloading. Then use <code>-f<\/code> to pick one:<\/p>\n\n<pre><code>$ yt-dlp -F \"URL\"<\/code><\/pre>\n\n<table>\n  <thead>\n    <tr>\n      <th>Command<\/th>\n      <th>What it does<\/th>\n    <\/tr>\n  <\/thead>\n  <tbody>\n    <tr>\n      <td>yt-dlp -f &#8220;bv*+ba&#8221; URL<\/td>\n      <td>Merges best video with best audio<\/td>\n    <\/tr>\n    <tr>\n      <td>yt-dlp -f &#8220;best[height&lt;=720]&#8221; URL<\/td>\n      <td>Caps resolution at 720p<\/td>\n    <\/tr>\n    <tr>\n      <td>yt-dlp -f &#8220;mp4&#8221; URL<\/td>\n      <td>Prefers MP4 container<\/td>\n    <\/tr>\n    <tr>\n      <td>yt-dlp -f &#8220;bv[ext=webm]+ba[ext=m4a]&#8221; URL<\/td>\n      <td>Pairs a WebM video track with M4A audio<\/td>\n    <\/tr>\n    <tr>\n      <td>yt-dlp &#8211;recode-video mp4 URL<\/td>\n      <td>Converts output to MP4 after download<\/td>\n    <\/tr>\n  <\/tbody>\n<\/table>\n\n<h2>Control Output File Names<\/h2>\n\n<p>Use <code>-o<\/code> with template variables to set custom paths and names:<\/p>\n\n<pre><code>$ yt-dlp -o \"~\/Videos\/%(title)s.%(ext)s\" \"URL\"<\/code><\/pre>\n\n<p>Prefix the filename with the upload date:<\/p>\n\n<pre><code>$ yt-dlp -o \"%(upload_date&gt;%Y-%m-%d)s - %(title)s.%(ext)s\" \"URL\"<\/code><\/pre>\n\n<div class=\"tip\">\n  <strong>Tip:<\/strong> Add <code>--no-part --no-continue<\/code> to prevent <code>.part<\/code> temporary files from appearing in your output directory.\n<\/div>\n\n<h2>Embed Metadata and Thumbnails<\/h2>\n\n<p>Write video tags and cover art directly into the output file:<\/p>\n\n<pre><code>$ yt-dlp --embed-metadata --embed-thumbnail \"URL\"<\/code><\/pre>\n\n<p>For live streams, save the chat as a JSON file alongside the video:<\/p>\n\n<pre><code>$ yt-dlp --write-chat \"LIVE_URL\"<\/code><\/pre>\n\n<h2>Use Cookies for Restricted Content<\/h2>\n\n<p>Age-gated or login-required pages need a valid session cookie. Export cookies from your browser and pass the file:<\/p>\n\n<pre><code>$ yt-dlp --cookies cookies.txt \"URL\"<\/code><\/pre>\n\n<p>Or let yt-dlp read cookies directly from an installed browser:<\/p>\n\n<pre><code>$ yt-dlp --cookies-from-browser firefox \"URL\"<\/code><\/pre>\n\n<div class=\"note\">\n  <strong>Note:<\/strong> Chrome and Chromium are also supported with <code>--cookies-from-browser chrome<\/code>.\n<\/div>\n\n<h2>Network and Bandwidth Options<\/h2>\n\n<h3>Route traffic through a proxy<\/h3>\n\n<pre><code>$ yt-dlp --proxy socks5:\/\/127.0.0.1:9050 \"URL\"<\/code><\/pre>\n\n<h3>Use aria2c for parallel segment downloads<\/h3>\n\n<p>Handing off to an external downloader<\/a> like aria2c can significantly increase speed on large files:<\/p>\n\n<pre><code>$ yt-dlp --external-downloader aria2c \\\n    --external-downloader-args \"-x 16 -k 1M\" \"URL\"<\/code><\/pre>\n\n<h3>Limit download speed<\/h3>\n\n<pre><code>$ yt-dlp --limit-rate 500K \"URL\"<\/code><\/pre>\n\n<h3>Add random pauses between requests<\/h3>\n\n<p>This reduces the chance of rate-limiting when downloading large playlists:<\/p>\n\n<pre><code>$ yt-dlp --sleep-interval 5 --max-sleep-interval 10 \"URL\"<\/code><\/pre>\n\n<h2>Automate With a yt-dlp Config File<\/h2>\n\n<p>Place a config file at <code>~\/.config\/yt-dlp\/config<\/code> to apply options automatically on every run. One flag per line:<\/p>\n\n<pre><code>--format bv*+ba\n--merge-output-format mp4\n--embed-thumbnail\n--embed-metadata\n--write-subs\n--sub-lang en\n--output ~\/Videos\/%(title)s.%(ext)s<\/code><\/pre>\n\n<p>To use a different config path, pass <code>--config-location \/path\/to\/config<\/code>.<\/p>\n\n<h2>Troubleshoot and Update yt-dlp<\/h2>\n\n<table>\n  <thead>\n    <tr>\n      <th>Command<\/th>\n      <th>Purpose<\/th>\n    <\/tr>\n  <\/thead>\n  <tbody>\n    <tr>\n      <td>yt-dlp &#8211;verbose URL<\/td>\n      <td>Print full debug output<\/td>\n    <\/tr>\n    <tr>\n      <td>yt-dlp &#8211;ignore-errors URL<\/td>\n      <td>Skip failed items and continue<\/td>\n    <\/tr>\n    <tr>\n      <td>yt-dlp &#8211;no-check-certificate URL<\/td>\n      <td>Bypass SSL verification (insecure)<\/td>\n    <\/tr>\n    <tr>\n      <td>yt-dlp -U<\/td>\n      <td>Install the latest available release<\/td>\n    <\/tr>\n  <\/tbody>\n<\/table>\n\n<div class=\"warning\">\n  <strong>Warning:<\/strong> <code>--no-check-certificate<\/code> disables SSL verification entirely. Only use it when you are certain the host is safe and no other option is available.\n<\/div>\n\n<h2>yt-dlp Command Quick Reference<\/h2>\n\n<table>\n  <thead>\n    <tr>\n      <th>Command<\/th>\n      <th>Purpose<\/th>\n    <\/tr>\n  <\/thead>\n  <tbody>\n    <tr><td>yt-dlp URL<\/td><td>Download best quality audio and video<\/td><\/tr>\n    <tr><td>yt-dlp -x &#8211;audio-format mp3 URL<\/td><td>Extract audio, convert to MP3<\/td><\/tr>\n    <tr><td>yt-dlp -x &#8211;audio-format best &#8211;no-keep-video URL<\/td><td>Extract audio without re-encoding<\/td><\/tr>\n    <tr><td>yt-dlp &#8211;write-subs &#8211;sub-lang en &#8211;embed-subs URL<\/td><td>Fetch and embed English captions<\/td><\/tr>\n    <tr><td>yt-dlp &#8211;write-auto-subs URL<\/td><td>Pull auto-generated captions<\/td><\/tr>\n    <tr><td>yt-dlp -f &#8220;bv*+ba&#8221; URL<\/td><td>Merge top video and audio streams<\/td><\/tr>\n    <tr><td>yt-dlp -F URL<\/td><td>List all available formats<\/td><\/tr>\n    <tr><td>yt-dlp -f &#8220;best[height&lt;=720]&#8221; URL<\/td><td>Cap resolution at 720p<\/td><\/tr>\n    <tr><td>yt-dlp -a urls.txt<\/td><td>Process URLs from a text file<\/td><\/tr>\n    <tr><td>yt-dlp &#8211;download-archive archive.txt PLAYLIST_URL<\/td><td>Skip already-downloaded items<\/td><\/tr>\n    <tr><td>yt-dlp &#8211;split-chapters -o &#8220;%(title)s &#8211; %(chapter)s.%(ext)s&#8221; URL<\/td><td>Create one file per chapter<\/td><\/tr>\n    <tr><td>yt-dlp &#8211;embed-metadata &#8211;embed-thumbnail URL<\/td><td>Write tags and cover art into output<\/td><\/tr>\n    <tr><td>yt-dlp &#8211;cookies cookies.txt URL<\/td><td>Access restricted content via cookies<\/td><\/tr>\n    <tr><td>yt-dlp &#8211;cookies-from-browser firefox URL<\/td><td>Read cookies from Firefox<\/td><\/tr>\n    <tr><td>yt-dlp &#8211;proxy socks5:\/\/127.0.0.1:9050 URL<\/td><td>Route through a SOCKS5 proxy<\/td><\/tr>\n    <tr><td>yt-dlp &#8211;limit-rate 500K URL<\/td><td>Cap throughput at 500 KB\/s<\/td><\/tr>\n    <tr><td>yt-dlp &#8211;hls-use-mpegts URL<\/td><td>Record HLS streams with MPEG-TS<\/td><\/tr>\n    <tr><td>yt-dlp &#8211;ignore-errors URL<\/td><td>Skip failed items without stopping<\/td><\/tr>\n    <tr><td>yt-dlp &#8211;verbose URL<\/td><td>Print full debug output<\/td><\/tr>\n    <tr><td>yt-dlp -U<\/td><td>Update to the latest release<\/td><\/tr>\n  <\/tbody>\n<\/table>\n\n<!-- FAQ Section -->\n<div class=\"faq-section\">\n  <h2>FAQs<\/h2>\n\n  <div class=\"faq-item\">\n    <input type=\"checkbox\" id=\"faq1\">\n    <label for=\"faq1\"><h3>Does yt-dlp work with age-restricted or login-required videos?<\/h3><\/label>\n    <div class=\"faq-answer\">\n      <p>Yes. Pass a cookie file with <code>--cookies cookies.txt<\/code>, or use <code>--cookies-from-browser firefox<\/code> to read credentials from an installed browser session directly.<\/p>\n    <\/div>\n  <\/div>\n\n  <div class=\"faq-item\">\n    <input type=\"checkbox\" id=\"faq2\">\n    <label for=\"faq2\"><h3>Does yt-dlp support M3U8 and HLS streaming playlists?<\/h3><\/label>\n    <div class=\"faq-answer\">\n      <p>Yes. yt-dlp handles M3U8 and other streaming formats by stitching segments automatically. Use <code>--hls-use-mpegts<\/code> when recording live streams to prevent file corruption on interruption.<\/p>\n    <\/div>\n  <\/div>\n\n  <div class=\"faq-item\">\n    <input type=\"checkbox\" id=\"faq3\">\n    <label for=\"faq3\"><h3>Is FFmpeg required to use yt-dlp?<\/h3><\/label>\n    <div class=\"faq-answer\">\n      <p>FFmpeg is required for merging separate video and audio streams, extracting audio, and any re-encoding tasks. Without it, yt-dlp can still download single-stream formats.<\/p>\n    <\/div>\n  <\/div>\n\n  <div class=\"faq-item\">\n    <input type=\"checkbox\" id=\"faq4\">\n    <label for=\"faq4\"><h3>How do I resume a broken yt-dlp download?<\/h3><\/label>\n    <div class=\"faq-answer\">\n      <p>Avoid <code>--no-part<\/code> so the partial <code>.part<\/code> file stays on disk. Re-run the same command \u2014 yt-dlp resumes from where it stopped if the server supports byte-range requests.<\/p>\n    <\/div>\n  <\/div>\n\n  <div class=\"faq-item\">\n    <input type=\"checkbox\" id=\"faq5\">\n    <label for=\"faq5\"><h3>How many websites does yt-dlp support?<\/h3><\/label>\n    <div class=\"faq-answer\">\n      <p>yt-dlp supports over a thousand platforms, including YouTube, Vimeo, Dailymotion, Twitch, and many regional and live-streaming sites. Run <code>yt-dlp --list-extractors<\/code> to see the full list.<\/p>\n    <\/div>\n  <\/div>\n\n<\/div>\n\n<\/body>\n<\/html>\n","protected":false},"excerpt":{"rendered":"<p>yt-dlp is a command-line tool that downloads videos and audio from YouTube, Vimeo, Dailymotion, and over a thousand other platforms. It handles format selection, subtitle embedding, audio extraction, metadata tagging, cookie-based authentication, and live stream recording. This page covers the most common yt-dlp commands, organized by task. Note: FFmpeg must be installed for stream merging,<\/p>\n","protected":false},"author":1,"featured_media":7993,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47],"tags":[],"class_list":["post-7992","post","type-post","status-publish","format-standard","has-post-thumbnail","category-arch-linux"],"_links":{"self":[{"href":"https:\/\/commandlinux.com\/wp-json\/wp\/v2\/posts\/7992","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/commandlinux.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/commandlinux.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/commandlinux.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/commandlinux.com\/wp-json\/wp\/v2\/comments?post=7992"}],"version-history":[{"count":2,"href":"https:\/\/commandlinux.com\/wp-json\/wp\/v2\/posts\/7992\/revisions"}],"predecessor-version":[{"id":8710,"href":"https:\/\/commandlinux.com\/wp-json\/wp\/v2\/posts\/7992\/revisions\/8710"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/commandlinux.com\/wp-json\/wp\/v2\/media\/7993"}],"wp:attachment":[{"href":"https:\/\/commandlinux.com\/wp-json\/wp\/v2\/media?parent=7992"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/commandlinux.com\/wp-json\/wp\/v2\/categories?post=7992"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/commandlinux.com\/wp-json\/wp\/v2\/tags?post=7992"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}