2016-01-21 18:15:46 -05:00
# youtube-dl
> Download videos from YouTube and other websites.
2024-04-04 01:34:14 -03:00
> See also: `yt-dlp`, `ytfzf`, `you-get`.
2024-10-12 10:02:00 +02:00
> More information: <https://rg3.github.io/youtube-dl/>.
2016-01-21 18:15:46 -05:00
- Download a video or playlist:
2020-10-19 20:53:00 +02:00
`youtube-dl '{{https://www.youtube.com/watch?v=oHg5SJYRHA0}}'`
2016-01-21 18:15:46 -05:00
2019-02-25 13:34:32 +08:00
- List all formats that a video or playlist is available in:
2025-04-22 06:20:48 +03:00
`youtube-dl {{[-F|--list-formats]}} '{{https://www.youtube.com/watch?v=Mwa0_nE9H7A}}'`
2019-02-25 13:34:32 +08:00
- Download a video or playlist at a specific quality:
2025-04-22 06:20:48 +03:00
`youtube-dl {{[-f|--format]}} "{{best[height<=480]}}" '{{https://www.youtube.com/watch?v=oHg5SJYRHA0}}'`
2019-02-25 13:34:32 +08:00
2016-01-21 18:56:49 -05:00
- Download the audio from a video and convert it to an MP3:
2016-01-21 18:15:46 -05:00
2025-04-22 06:20:48 +03:00
`youtube-dl {{[-x|--extract-audio]}} --audio-format {{mp3}} '{{url}}'`
2016-01-21 18:15:46 -05:00
2020-01-26 14:53:12 +02:00
- Download the best quality audio and video and merge them:
2025-04-22 06:20:48 +03:00
`youtube-dl {{[-f|--format]}} bestvideo+bestaudio '{{url}}'`
2020-01-26 14:53:12 +02:00
2016-01-21 18:15:46 -05:00
- Download video(s) as MP4 files with custom filenames:
2025-04-22 06:20:48 +03:00
`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}}'`
2016-01-21 18:15:46 -05:00
2020-04-19 14:17:24 +01:00
- Download a particular language's subtitles along with the video:
2016-01-21 18:15:46 -05:00
2020-10-19 20:53:00 +02:00
`youtube-dl --sub-lang {{en}} --write-sub '{{https://www.youtube.com/watch?v=Mwa0_nE9H7A}}'`
2020-07-21 22:46:21 +03:00
2021-08-15 19:59:09 +02:00
- Download a playlist and extract MP3s from it:
2020-07-21 22:46:21 +03:00
2025-04-22 06:20:48 +03:00
`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}}'`