This is the yt-dlp command that I use for archiving stuff.
yt-dlp \
-f bv+ba/b \
--cookies-from-browser firefox \
--restrict-filenames \
--convert-thumbnails png \
--sub-langs all \
--no-write-auto-subs \
--embed-subs \
--embed-chapters \
--embed-thumbnail \
--embed-info-json \
--embed-metadata \
--compat-options no-live-chat \
"https://www.youtube.com/watch?v=dQw4w9WgXcQ"
Some quick explanation:
-f bv+ba/b: format selection - the best video-only stream with the best audio-only stream. If separate streams are not available, fall back to best combined format--cookies-from-browser firefox: browser cookies to get that sweet premium 1080p bitrate + other advantages of being logged-in--restrict-filenames: self-explanatory, stick to only ASCII characters in the filename. Spaces and & are also avoided--embed-info-json and --embed-metadata: making sure we gather the most metadata as possible--embed-chapters: same, but with chapter markers--convert-thumbnails png and --embed-thumbnail: Convert thumbnail to a common format and embed it--sub-langs all: get all available subtitles--no-write-auto-subs: skip auto-generated subtitles--embed-subs: embed subs directly in the video file so we don’t have to handle a bunch of .srt files--compat-options no-live-chat: skip live chat replay