Skip to content

Instantly share code, notes, and snippets.

@protrolium
Last active December 24, 2023 19:08
Show Gist options
  • Save protrolium/cf1360de499fc046ff65 to your computer and use it in GitHub Desktop.
Save protrolium/cf1360de499fc046ff65 to your computer and use it in GitHub Desktop.
youtube-dl syntax

youtube-dl will output in the current directory

To list available formats

youtube-dl --list-formats URL

To download an entire user/channel

youtube-dl -citw ytuser:<USER> or youtube-dl -citw URL

To download all videos on a playlist

youtube-dl -citw <PLAYLIST URL>

To download a YouTube video as an MP3

youtube-dl -x --audio-format mp3 --audio-quality 320K <VIDEO_URL>

To download best availble video (mp4) and best available audio (m4a) and then merge them together

youtube-dl -citw -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]' <VIDEO_URL>

add cookie file to donwload session video (vimeo)

youtube-dl --cookie "path/to/cookie.txt" <VIDEO_URL>

download Youtube Live-Stream

youtube-dl --list-formats
then
youtube-dl -f <format number> <url>

@AchmadFathoni
Copy link

Download audio and English subtitle

youtube-dl -f 'bestaudio[ext=m4a]' --write-sub --sub-lang en <VIDEO_URL>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment