Skip to content

Instantly share code, notes, and snippets.

@lebanni
Last active August 18, 2023 02:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lebanni/44087e79dfe6260c832fab07f24cc228 to your computer and use it in GitHub Desktop.
Save lebanni/44087e79dfe6260c832fab07f24cc228 to your computer and use it in GitHub Desktop.
yt-dlp options
# Download best mp4 format available or any other best if no mp4 available
$ youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best'
# Download best format available but no better than 480p
$ youtube-dl -f 'bestvideo[height<=480]+bestaudio/best[height<=480]'
# Download best video only format but no bigger than 50 MB
$ youtube-dl -f 'best[filesize<50M]'
# Download best format available via direct link over HTTP/HTTPS protocol
$ youtube-dl -f '(bestvideo+bestaudio/best)[protocol^=http]'
# Download the best video format and the best audio format without merging them
$ youtube-dl -f 'bestvideo,bestaudio' -o '%(title)s.f%(format_id)s.%(ext)s'
Download embed subs
yt-dlp -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' -o '%(title)s.f%(format_id)s.%(ext)s' --write-sub --sub-lang fr --embed-sub https://youtu.be/qcga8ATBNh0
Ex :
yt-dlp -f "bestaudio[ext=m4a]/best[ext=mp4]/best" -o "%(upload_date>%Y%m%d)s - %(title)s.%(ext)s" https://www.youtube.com/channel/UCnn1Ps-YvrMVgiJNJb6IWCg
yt-dlp -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" -o "%(upload_date>%Y%m%d)s - %(title)s.%(ext)s" https://www.youtube.com/channel/UCnn1Ps-YvrMVgiJNJb6IWCg
yt-dlp -f "bestaudio[ext=m4a]/best[ext=m4a]/best" -o "%(upload_date>%Y)s - %(title)s.%(ext)s" --add-metadata --no-mtime --parse-metadata "%(upload_date,release_year).4s:(?P<meta_date>.+)"
ARTE :
lister les formats dispo avec yt-dlp -F <url>
yt-dlp -f 'VF-STF-program_audio_0-VF+VF-STF-2292' https://www.arte.tv/fr/videos/095168-000-A/isaac-asimov-l-etrange-testament-du-pere-des-robots/ -o '%(title)s.f%(format_id)s.%(ext)s' --write-sub --sub-lang fr --embed-sub
Download audio channel :
yt-dlp -f "bestaudio[ext=m4a]/best[ext=mp4]/best" -o "%(upload_date>%Y%m%d)s - %(title)s.%(ext)s" https://www.youtube.com/channel/UCnn1Ps-YvrMVgiJNJb6IWCg
Download audio + video channel :
yt-dlp -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" -o "%(upload_date>%Y%m%d)s - %(title)s.%(ext)s" https://www.youtube.com/channel/UCnn1Ps-YvrMVgiJNJb6IWCg
Download audio + metadata channel :
yt-dlp -f "bestaudio[ext=m4a]/best[ext=m4a]/best" -o "%(upload_date>%Y)s - %(title)s.%(ext)s" --add-metadata --no-mtime --parse-metadata "%(upload_date,release_year).4s:(?P<meta_date>.+)" https://www.youtube.com/channel/UCnn1Ps-YvrMVgiJNJb6IWCg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment