Skip to content

Latest commit

 

History

History
76 lines (50 loc) · 1.77 KB

yt-dlp.md

File metadata and controls

76 lines (50 loc) · 1.77 KB

yt-dlp

Extract audio from and store as MP3

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.

Download playlist

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>

Use browser cookies for downloading streams

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>

Exclude VP9 (or other) codec from downloader

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.

Download CloudFlare streams

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