node-youtube-uploader icon indicating copy to clipboard operation
node-youtube-uploader copied to clipboard

Youtube video uploader library for Node.js (python wrapper)

Youtube Uploader

NPM NPM

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().

Dependencies

  • python: Python must be installed and should be executable by python command.

Installation

$ npm install youtube-uploader

Usage

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 (err, videoId) {
    // ...
  });
});

Credits

See the contributors.

License

The MIT License (MIT)

Copyright (c) 2013-2014 Pilwon Huh

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Analytics