https://github.com/yt-dlp/yt-dlp
# Download a video or playlist (youtube and vimeo)
yt-dlp "<https://www.youtube.com/shorts/T9tUFI7Fsmw>"
# List the available downloadable formats for a video:
yt-dlp --list-formats "<https://www.youtube.com/watch?v=oHg5SJYRHA0>"
# Download a video with a defined format, in this case the best mp4 video available (default is "bv\\*+ba/b"):
yt-dlp --format "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4]" "<https://www.youtube.com/shorts/T9tUFI7Fsmw>"
# Download a video with a defined format, in this case the best mp4 video available (default is "bv\\*+ba/b"):
# use ffmpeg to encode to 24fps
yt-dlp ^
--format "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4]" ^
--downloader ffmpeg ^
--downloader-args "ffmpeg:-filter:v fps=24 -vcodec h264" ^
"<https://www.youtube.com/playlist?list=PLkYI1h-YJAOtALhP5wkDM6888BhFzrj6M>"
# Extract audio from a video (requires ffmpeg or ffprobe):
yt-dlp --extract-audio "<https://www.youtube.com/watch?v=oHg5SJYRHA0>"
# Specify audio format and audio quality of extracted audio (between 0 (best) and 10 (worst), default = 5):
yt-dlp --extract-audio --audio-format mp3 --audio-quality 0 "<https://www.youtube.com/watch?v=oHg5SJYRHA0>"
# Specify audio format and audio quality of extracted audio (between 0 (best) and 10 (worst), default = 5):
yt-dlp --extract-audio --audio-format m4a --audio-quality 0 "<https://www.youtube.com/watch?v=qHNUeBK8k7Q>" -o %(title)s.%(ext)s
# Extrtact audio with metadata
yt-dlp ^
--output "%(title)s.%(ext)s" ^
--update ^
--ignore-config ^
--yes-playlist ^
--write-playlist-metafiles ^
--format bestaudio ^
--extract-audio ^
--embed-thumbnail ^
--embed-metadata ^
--add-metadata ^
--embed-chapters ^
--convert-thumbnails jpg ^
--parse-metadata "title:%(artist)s - %(title)s" ^
--parse-metadata ":(?P<meta_synopsis>)" ^
--parse-metadata "channel:%(album)s" --add-metadata ^
--parse-metadata "%(track_number,playlist_index|0)s:%(track_number)s" --add-metadata ^
--parse-metadata "title:(?s)(?P<meta_album_artist>.+)" --add-metadata ^
"<https://www.youtube.com/watch?v=ALUKDkOxVPo>"