Created
November 14, 2016 12:33
-
-
Save pirafrank/20ecefda12e8bb47fe4eba59621b08ff to your computer and use it in GitHub Desktop.
Quick script to automate video upload from CLI to YouTube. Replace 'francesco' with your own username.
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 | |
# Quick script to automate video upload from CLI to YouTube. | |
# More info and requirements at https://github.com/tokland/youtube-upload | |
# BEFORE starting: replace 'francesco' with your own username to make it work! | |
if [[ $# != 3 ]]; then | |
echo "Error: wrong number of arguments. It should be 3, you put $#." | |
echo "Usage: ./youtube-uploader-cli.sh [video title] [video path] [public | unlisted | private]" | |
exit -1 | |
fi | |
# running vars | |
VIDEO_TITLE="$1" | |
VIDEO_PATH="$2" | |
PRIVACY="$3" | |
# pre-set vars | |
CLIENT_SECRETS="/home/francesco/.config/youtube-upload/client_secrets.json" | |
CRED_FILE="/home/francesco/.config/youtube-upload/youtube-upload-credentials.json" | |
if [[ $(whoami) != "francesco" ]]; then | |
echo "This script must be run by francesco users! Exiting..." | |
exit 1 | |
fi | |
PYTHONPATH=. python /home/francesco/documents/youtube-upload-master/bin/youtube-upload --title "$VIDEO_TITLE" "$VIDEO_PATH" --client-secrets=$CLIENT_SECRETS --credentials-file=$CRED_FILE --privacy=$PRIVACY | |
echo "Done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment