I've just copied a simple example from Youtube docs but it fails. I want to implement Youtube data API in my project.
Following these links:
Youtube data api quickstart documentation
Youtube data api quickstart github repo
- I've created a new project in Google Developers Console
- Added OAuth credentials
- Downloaded my
"client_secret.json"file - Copied quickstart project into my working folder
But when I run this script an error occurs:
~/workspace/youtube/quickstart $ node test-1.js
/home/ubuntu/workspace/youtube/quickstart/test-1.js:31
var clientSecret = credentials.installed.client_secret;
^
TypeError: Cannot read property 'client_secret' of undefined
at authorize (/home/ubuntu/workspace/youtube/quickstart/test-1.js:31:43)
at processClientSecrets (/home/ubuntu/workspace/youtube/quickstart/test-1.js:20:3)
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:446:3)
Where did I possibly make a mistake and how to fix it?