Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Quick script to automate video upload from CLI to YouTube. Replace 'francesco' with your own username.
#!/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
You can’t perform that action at this time.