HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

youtube-dl — Download videos from YouTube and other websites. See also: `yt-dlp`, `ytfzf`, `you-get`. More inform

Submitted by: @import:tldr-pages··
0
Viewed 0 times
youtube-dlcommandfromandclivideosdownloadyoutube

Problem

How to use the youtube-dl command: Download videos from YouTube and other websites. See also: yt-dlp, ytfzf, you-get. More information: <https://rg3.github.io/youtube-dl/>.

Solution

youtube-dl — Download videos from YouTube and other websites. See also: yt-dlp, ytfzf, you-get. More information: <https://rg3.github.io/youtube-dl/>.

Download a video or playlist:
youtube-dl '{{https://www.youtube.com/watch?v=oHg5SJYRHA0}}'


List all formats that a video or playlist is available in:
youtube-dl {{[-F|--list-formats]}} '{{https://www.youtube.com/watch?v=Mwa0_nE9H7A}}'


Download a video or playlist at a specific quality:
youtube-dl {{[-f|--format]}} "{{best[height<=480]}}" '{{https://www.youtube.com/watch?v=oHg5SJYRHA0}}'


Download the audio from a video and convert it to an MP3:
youtube-dl {{[-x|--extract-audio]}} --audio-format {{mp3}} '{{url}}'


Download the best quality audio and video and merge them:
youtube-dl {{[-f|--format]}} bestvideo+bestaudio '{{url}}'


Download video(s) as MP4 files with custom filenames:
youtube-dl {{[-f|--format]}} {{mp4}} {{[-o|--output]}} "{{%(playlist_index)s-%(title)s by %(uploader)s on %(upload_date)s in %(playlist)s.%(ext)s}}" '{{url}}'


Download a particular language's subtitles along with the video:
youtube-dl --sub-lang {{en}} --write-sub '{{https://www.youtube.com/watch?v=Mwa0_nE9H7A}}'


Download a playlist and extract MP3s from it:
youtube-dl {{[-f|--format]}} "bestaudio" {{[-c|--continue]}} {{[-w|--no-overwrites]}} {{[-i|--ignore-errors]}} {{[-x|--extract-audio]}} --audio-format mp3 {{[-o|--output]}} "%(title)s.%(ext)s" '{{url_to_playlist}}'

Code Snippets

Download a video or playlist

youtube-dl '{{https://www.youtube.com/watch?v=oHg5SJYRHA0}}'

List all formats that a video or playlist is available in

youtube-dl {{[-F|--list-formats]}} '{{https://www.youtube.com/watch?v=Mwa0_nE9H7A}}'

Download a video or playlist at a specific quality

youtube-dl {{[-f|--format]}} "{{best[height<=480]}}" '{{https://www.youtube.com/watch?v=oHg5SJYRHA0}}'

Download the audio from a video and convert it to an MP3

youtube-dl {{[-x|--extract-audio]}} --audio-format {{mp3}} '{{url}}'

Download the best quality audio and video and merge them

youtube-dl {{[-f|--format]}} bestvideo+bestaudio '{{url}}'

Context

tldr-pages: common/youtube-dl

Revisions (0)

No revisions yet.