I want to retrieve monetization data from a friend\'s YouTube channel. I\'ve used the python code below to get the authentication credentials from him, which I then saved to
I would just open the file and dump the json into a dictionary.
def read_config(config):
# config is the name/path to your config file
with open(config, 'r') as infile:
config = json.load(infile)
return(config)
config = read_config("yourfile.json")
id, secret = config["client_id"], config['client_secret"]
Solved it myself. I just needed to create the credentials object with this code:
credentials = google.oauth2.credentials.Credentials.from_authorized_user_file(CLIENT_CREDENTIALS_FILE)