Skip to content

Instantly share code, notes, and snippets.

@xuyuji9000
Last active August 25, 2024 05:25
Show Gist options
  • Save xuyuji9000/0b850c17b8c8b7439eced27a5b194524 to your computer and use it in GitHub Desktop.
Save xuyuji9000/0b850c17b8c8b7439eced27a5b194524 to your computer and use it in GitHub Desktop.
This gist documents a list of examples of yt-dlp
# This gist documents a list of examples of using `yt-dlp` command
# to download video assets from the YouTube platform
VIDEO_URL="https://www.youtube.com/watch?v=9tU3-WSyEhA"
# List available format
yt-dlp -F "${VIDEO_URL}"
# Download specific format
# 140: mp4a
# 399: 1080p mp4
FORMAT_CODE=''
yt-dlp \
-f "${FORMAT_CODE}" \
"${VIDEO_URL}"
# Merge video and audio
VIDEO=""
AUDIO=""
ffmpeg \
-i "${VIDEO}" \
-i "${AUDIO}" \
-c copy output.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment