Skip to content

Instantly share code, notes, and snippets.

@einarnn
Last active August 19, 2022 15:00
Show Gist options
  • Save einarnn/e425aa31b5e130b5b4a893416ff8c31b to your computer and use it in GitHub Desktop.
Save einarnn/e425aa31b5e130b5b4a893416ff8c31b to your computer and use it in GitHub Desktop.
YT Download
#!/bin/bash
#
# download a youtube URL using yt-dlp
#
# before using:
#
# - create Python virtual environment
# - `pip install yt-dlp`
#
URL="$1"
# format 22 is (mp4, 1280x720, 30fps)
OPFILE=`yt-dlp -f 22 "$URL" | perl -ne 'if(/\[download\] Destination: (.+)$/){print "$1"}'`
echo Downloaded "$OPFILE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment