2022-02-21 01:33:08 +01:00
|
|
|
# yt-dlp
|
|
|
|
|
|
|
|
> A youtube-dl fork with additional features and fixes.
|
|
|
|
> Download videos from YouTube and other websites.
|
2025-06-21 03:04:18 +00:00
|
|
|
> See also: `ytfzf`.
|
2022-02-21 01:33:08 +01:00
|
|
|
> More information: <https://github.com/yt-dlp/yt-dlp>.
|
|
|
|
|
|
|
|
- Download a video or playlist (with the default options from command below):
|
|
|
|
|
|
|
|
`yt-dlp "{{https://www.youtube.com/watch?v=oHg5SJYRHA0}}"`
|
|
|
|
|
2023-02-19 14:30:37 +02:00
|
|
|
- List the available downloadable formats for a video:
|
|
|
|
|
2025-04-22 06:20:48 +03:00
|
|
|
`yt-dlp {{[-F|--list-formats]}} "{{https://www.youtube.com/watch?v=oHg5SJYRHA0}}"`
|
2023-02-19 14:30:37 +02:00
|
|
|
|
2024-06-04 09:06:13 +01:00
|
|
|
- Download a video or playlist using the best MP4 video available (default is "bv\*+ba/b"):
|
2022-02-21 01:33:08 +01:00
|
|
|
|
2025-04-22 06:20:48 +03:00
|
|
|
`yt-dlp {{[-f|--format]}} "{{bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4]}}" "{{https://www.youtube.com/watch?v=oHg5SJYRHA0}}"`
|
2022-02-21 01:33:08 +01:00
|
|
|
|
2023-02-19 14:30:37 +02:00
|
|
|
- Extract audio from a video (requires ffmpeg or ffprobe):
|
2022-02-21 01:33:08 +01:00
|
|
|
|
2025-04-22 06:20:48 +03:00
|
|
|
`yt-dlp {{[-x|--extract-audio]}} "{{https://www.youtube.com/watch?v=oHg5SJYRHA0}}"`
|
2022-02-21 01:33:08 +01:00
|
|
|
|
2023-02-19 14:30:37 +02:00
|
|
|
- Specify audio format and audio quality of extracted audio (between 0 (best) and 10 (worst), default = 5):
|
2022-02-21 01:33:08 +01:00
|
|
|
|
2025-04-22 06:20:48 +03:00
|
|
|
`yt-dlp {{[-x|--extract-audio]}} --audio-format {{mp3}} --audio-quality {{0}} "{{https://www.youtube.com/watch?v=oHg5SJYRHA0}}"`
|
2022-02-21 01:33:08 +01:00
|
|
|
|
2024-11-15 06:21:14 -06:00
|
|
|
- Download only the second, fourth, fifth, sixth, and last items in a playlist (the first item is 1, not 0):
|
|
|
|
|
2025-04-22 06:20:48 +03:00
|
|
|
`yt-dlp {{[-I|--playlist-items]}} 2,4:6,-1 "{{https://youtube.com/playlist?list=PLbzoR-pLrL6pTJfLQ3UwtB-3V4fimdqnA}}"`
|
2024-11-15 06:21:14 -06:00
|
|
|
|
2024-06-04 09:06:13 +01:00
|
|
|
- Download all playlists of a YouTube channel/user keeping each playlist in a separate directory:
|
2022-02-21 01:33:08 +01:00
|
|
|
|
2025-04-22 06:20:48 +03:00
|
|
|
`yt-dlp {{[-o|--output]}} "{{%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s}}" "{{https://www.youtube.com/user/TheLinuxFoundation/playlists}}"`
|
2022-02-21 01:33:08 +01:00
|
|
|
|
2024-06-04 09:06:13 +01:00
|
|
|
- Download a Udemy course keeping each chapter in a separate directory:
|
2022-02-21 01:33:08 +01:00
|
|
|
|
2025-04-22 06:20:48 +03:00
|
|
|
`yt-dlp {{[-u|--username]}} {{user}} {{[-p|--password]}} {{password}} {{[-P|--paths]}} "{{path/to/directory}}" {{[-o|--output]}} "{{%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s}}" "{{https://www.udemy.com/java-tutorial}}"`
|