youtube-uploader

Youtube video uploader library for Node.js

Youtube Uploader

youtube-uploader is a Youtube video uploader library written in Node.js.

This library wraps Google's sample code written in Python: upload_video.py. OAuth2 configuration files (client_secrets.json and upload_video.py-oauth2.json) are required by the python script and they can be conveniently generated by calling configure() before upload().

  • python: Python must be installed and should be executable by python command.
$ npm install youtube-uploader
var youtubeUploader = require('youtube-uploader');
 
youtubeUploader.configure({
  accessToken: ACCESS_TOKEN,  // string 
  clientId: CLIENT_ID,  // string 
  clientSecret: CLIENT_SECRET,  // string 
  expiresIn: EXPIRES_IN,  // string (default: '3600') 
  idToken: ID_TOKEN,  // string 
  refreshToken: REFRESH_TOKEN,  // string 
  tokenType: TOKEN_TYPE  // string (default: 'Bearer') 
}, function (err) {
  if (err) { return console.error(err.message); }
  youtubeUploader.upload({
    path: VIDEO_PATH,  // string 
    title: TITLE,  // string 
    description: DESCRIPTION,  // string 
    keywords: KEYWORDS,  // array of string 
    category: CATEGORY_ID,  // string (refer to https://developers.google.com/youtube/v3/docs/videoCategories/list) 
    privacy: PRIVACY  // 'public', 'private', or 'unlisted' 
  }, function (errvideoId) {
    // ... 
  });
});

See the contributors.

youtube-uploader is released under the MIT License.