To extract audio, use -x
, and to store in MP3 format, use
--audio-format mp3
.
yt-dlp -x --audio-format mp3 ...
Additionally, use --audio-quality 0
to use the best quality audio stream.
To download a playlist while keeping the files numbered by playlist order, use
-o
and format the output as:
yt-dlp -o "%(playlist_index)s %(title)s.%(ext)s" <playlist>
First, extract cookies from a web browser. The cookies.txt Firefox addon can output them in a Netscape Cookie format text file.
Note, a properly formatted Netscape HTTP Cookie file is tab-delimited and contains the header:
# Netscape HTTP Cookie File
Next, format the yt-dlp
command:
yt-dlp --cookies=<cookie file> <url>
To prevent downloading VP9 streams, adjust the format string as follows:
-f "bestvideo[vcodec!~='vp0?9']"
VP9 codecs can often be reported as vp9
or vp09
, so use an optional 0
to
catch both cases.
Note: The format string must be quoted for this to work.
On the website, inspect the video frame in the right-click context menu, and open it in a new tab. The URL will be formatted:
https://customer-<ACCOUNTID>.cloudflarestream.com/<VIDEOID>/iframe&...
To download the video, run:
yt-dlp https://customer-<ACCOUNTID>.cloudflarestream.com/<VIDEOID>/manifest/video.m3u8
CloudFlare encodes multiple files in a variety of video/audio codecs. To list those available, run:
curl https://customer-<ACCOUNTID>.cloudflarestream.com/<VIDEOID>/manifest/video.m3u8