A guide to using yt-dlp, a command-line tool for downloading audio and video from YouTube and other sites.
yt-dlp
is a feature-rich command-line audio/video downloader with support for thousands of sites. The project is a fork of youtube-dl based on the now inactive youtube-dlc. This guide will walk you through the installation, update, and basic usage of yt-dlp
for downloading YouTube videos.
https://github.com/yt-dlp/yt-dlp
Download yt-dlp
pip install -U "yt-dlp[default]"
update yt-dlp
pip install yt-dlp --upgrade
check version
yt-dlp --version
Start download youtube
get video titles
yt-dlp --cookies-from-browser firefox --get-title 'https://www.youtube.com/watch?v=yBl8UdSav5Y'
download video to mp3 format
yt-dlp --cookies-from-browser chrome -x --audio-format mp3 --audio-quality 0 'https://www.youtube.com/watch?v=FkOpwodhROI'
download video with timestamp
yt-dlp --cookies-from-browser chrome --download-sections '*00:02-03:00' 'https://www.youtube.com/watch?v=FkOpwodhROI'
download video to mp4 with timestamp
yt-dlp -f mp4 --cookies-from-browser chrome --download-sections '*00:02-03:00' 'https://www.youtube.com/watch?v=FkOpwodhROI'
=