yt-dlp is an [[Unlicense]] licensed video downloader written in [[Python]].
- Website
- [Source](https://github.com/yt-dlp/yt-dlp)
- Documentation
- [AlternativeTo](https://alternativeto.net/software/yt-dlp/)
> yt-dlp is a feature-rich command-line audio/video downloader with support for thousands of sites.
# Notability
# Philosophy
Fork of `youtube-dl` and now-abandoned `youtube-dlc`.
## Downstream Forks
```cardlink
url: https://github.com/jmbannon/ytdl-sub
title: "GitHub - jmbannon/ytdl-sub: Lightweight tool to automate downloading and metadata generation with yt-dlp"
description: "Lightweight tool to automate downloading and metadata generation with yt-dlp - jmbannon/ytdl-sub"
host: github.com
favicon: https://github.githubassets.com/favicons/favicon.svg
image: https://opengraph.githubassets.com/46aa93bea364de3f4afa0cc574993ba0471e38595d41d3c85b5fa6d0f268e097/jmbannon/ytdl-sub
```
> downloads media via yt-dlp and prepares it for your favorite media player, including Kodi, Jellyfin, Plex, Emby, and modern music players
# Platform Support
Built on [[Python]] v3 but exported as single binary.
- [[Linux]]
- [[MacOS]]
- [[Windows]]
# Features
- [[SponsorBlock]] integration
- Format sorting and preference by better codecs not just bitrate
- Download comments with `--write-comments`
- Embedding thumbnails directly into files ([[Ogg Vorbis]], [[MP4]])
- Supports downloading clips and stories
- Supports downloading active live streams from beginning
- Download all videos from channel at once
- Cookies can be pulled directly from browser
- Download sections of videos with `--download-sections` and a time range
- Integrates with external downloaders for certain formats
- Configuration files for defaults
# Tips
## Download Automatic Subtitles
Sometimes the automatic subtitles don't come over unless you specify them.[^2]
```sh
yt-dlp --write-auto-subs
```
## Don't Download Video
Good for when you only want to download metadata, subs, chat logs, etc.[^2]
```sh
yt-dlp --skip-download
```
## Use Specific Browser
It only supports [[Firefox]] and [[Chrome]] out of the box, but there are some tricks that allow you to pass in the path of other browser profiles which use the same cookie file format.
```sh
yt-dlp --cookies-from-browser "firefox:/path/to/browser/profile"
```
Or a specific cookie database:
```sh
yt-dlp --cookies "/full/path/to/cookies.sqlite"
```
## Download from YouTube
YT started doing JS-based "DRM", so `yt-dlp` requires a JS runtime.[^1] For example [[Deno - JS Runtime|Deno]] available via [[Homebrew]]:
```sh
brew install deno
```
## Download URLs From File
```sh
yt-dlp -a file_of_urls.txt
```
The file just needs to have one URL per line.
## Audio Only
For when all you want is the audio track, discarding any video.
```sh
yt-dlp -x
```
Requires [[FFMPEG]], as it typically needs to download the whole thing and then extracts the audio afterward.
# References
[^1]: https://github.com/yt-dlp/yt-dlp/issues/14404
[^2]: https://superuser.com/questions/927523/how-to-download-only-subtitles-of-videos-using-youtube-dl