yt-dlp

From RaySoft

yt-dlp is a youtube-dl fork based on the now inactive youtube-dlc. The main focus of this project is adding new features and patches while also keeping up to date with the original project.[1]

Documentation

Syntax

yt-dlp [PARAMETER ...] URL [URL ...]

Parameters

--audio-format FORMAT
Specify audio format to convert the audio to when -x is used. Currently supported formats are: best (default) or one of aac, flac, mp3, m4a, opus, vorbis, wav, alac.
-c, --continue
Resume partially downloaded files/fragments (default).
--cache-dir DIR
Location in the filesystem where yt-dlp can store some downloaded information (such as client ids and signatures) permanently. By default $XDG_CACHE_HOME/yt-dlp or ~/.cache/yt-dlp.
-k, --keep-video
Keep the intermediate video file on disk after post-processing.
-o TEMPLATE, --output TEMPLATE
Output filename TEMPLATE.
-q, --quiet
Activate quiet mode. If used with -–verbose, print the log to stderr.
--restrict-filenames
Restrict filenames to only ASCII characters, and avoid & and spaces in filenames.
--rm-cache-dir
Delete all filesystem cache files.
-x, --extract-audio
Convert video files to audio-only files (requires ffmpeg).

Examples

Save a music video as a mp3 file
[[ -d "${path}" ]] || mkdir --parents "${path}"

yt-dlp \
  --audio-format 'mp3' \
  --cache-dir "${HOME}/tmp" \
  --extract-audio \
  --output "${path}/%(title)s.%(ext)s" \
  --quiet \
  --restrict-filenames \
  --rm-cache-dir \
  'https://www.youtube.com/watch?v=pAgnJDJN4VA'

References