Last active
February 8, 2019 17:11
-
-
Save silveraid/d0b7b29d9010b623addc383afd1426b2 to your computer and use it in GitHub Desktop.
Simple tool to automate fetching videos on MacOSX from YouTube
This file contains 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 | |
# Simple tool to automate fetching videos on MacOSX from YouTube | |
# Installing dependencies: | |
# pip install youtube-dl | |
# brew install libav | |
echo "Resetting clipboard ..." | |
echo "-" | pbcopy | |
while [ true ]; do | |
echo -n "Waiting for URL ..." | |
url="-" | |
while [ "${url}" == "-" ]; do | |
echo -n "." | |
sleep 1 | |
url=$(pbpaste) | |
done | |
echo "!" | |
# calling youtube-dl | |
youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio' --merge-output-format mp4 ${url} | |
# resetting clipboard | |
echo "-" | pbcopy | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment