Script for updating Youtube video's privacy status using OAuth
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Script for updating Youtube video's privacy status using OAuth

This code is to be run automatically to update a Youtube video's privacy status

First, generate your key using "get-token.php" - read the notes below for generation Next, update this file with the appropriate information (path to key file, Client ID, Client Secret (OAuth Required), Application Name, Database Login, Database Query, and location of PHP Client Library - all download information is below)

@author Kyle Perkins @site

NOTICE: Rest of copyright should be in tact for other scripts (Dom Sammut ( and Ibrahim Ulukaya (Google) Last Update: 20160108

Primary code from Mixed with sample code from (PHP #1)

#Before you begin

##Generate OAuth credentials Create Client ID and Client Secret by creating OAuth credentialsat MAKE SURE YOU UPDATE YOUR REDIRECT URL TO MATCH!!!!!!!!!

##Save the return in a file Generate the "the_key" with get-token.php and store it into "the_key.txt" or wherever you want to store it BEFORE running this script. Also, make sure "the_key" has a REFRESH TOKEN!

##Get the Google PHP Client Library Download the PHP Client Library from Google at

##Set the permissions Make sure that your server can read/write "the_key.txt" or else you'll get a "Cannot json decode" error

##Update the variables Variables to set up are $CLIENT_ID, $CLIENT_SECRET, $application_name, $VIDEO_ID (if not already pulled), path to $key_file, PDO SQL Login, path to PHP Client Library, and $redirect (redirect url)