Last active
August 19, 2022 15:00
-
-
Save einarnn/e425aa31b5e130b5b4a893416ff8c31b to your computer and use it in GitHub Desktop.
YT Download
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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