Thursday, 20 April 2017

got error while upload video in youtube Error: Login Required

While upload video in youtube in node using Key I got Login required error.

'use strict';

var google = require('../../lib/googleapis');
var util = require('util');
var fs = require('fs');
var API_KEY = "AI..............xE";

var FILENAME = 'test4.mp4';


var youtube = google.youtube({
  version: 'v3',
  auth: API_KEY
});
function uploadVideo () {
  var req = youtube.videos.insert({
    part: 'id,snippet,status',
    notifySubscribers: false,
    resource: {
      snippet: {
        title: 'New video',
        description: 'Testing YouTube upload via Google APIs Node.js Client'
      },
      status: {
        privacyStatus: 'private'
      }
    },
    media: {
      body: fs.createReadStream(FILENAME)
    }
  }, function (err, data) {
    if (err) {
      console.error('Error: ' + err);
    }
    if (data) {
      console.log(util.inspect(data, false, null));
    }
    process.exit();
  });

 
uploadVideo();

got error like Error: Error: Login Required

how i upload video using key in node.js.

upload video without using oauth redirect url.



via Sandip Mavani

No comments:

Post a Comment