From 87f3fbd20fc4a66cf46f8c4fdd807d7741694561 Mon Sep 17 00:00:00 2001 From: rexim Date: Tue, 30 May 2017 20:16:34 +0700 Subject: [PATCH] Add flow_from_config (#16) --- youtube/youtube.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/youtube/youtube.py b/youtube/youtube.py index 9a56b89..1e92a18 100644 --- a/youtube/youtube.py +++ b/youtube/youtube.py @@ -9,6 +9,16 @@ from oauth2client.file import Storage +def flow_from_config(config): + client_secret_file_path = config["youtube"]["client_secret_file_path"] + flow = flow_from_clientsecrets( + client_secret_file_path, + scope="https://www.googleapis.com/auth/youtube", + message="Cannot find %s file. Please create it" % (client_secret_file_path) + ) + return flow + + # TODO(bc02b696-9ad8-4572-8faa-58caed05f612): authorization and credential storage # # Develop a mechanism for storing and retrieving credentials for