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