From eeab50962e7831b3fdc57887bde02af637a5d954 Mon Sep 17 00:00:00 2001 From: poespas Date: Thu, 25 Oct 2018 21:07:03 +0100 Subject: [PATCH] Title can't be longer than 70 characters on yt --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index dfca8c3..a8f8dc7 100644 --- a/index.js +++ b/index.js @@ -19,6 +19,10 @@ util.inherits(resumableUpload, EventEmitter); //Init the upload by POSTing google for an upload URL (saved to self.location) resumableUpload.prototype.upload = function() { var self = this; + if ((this.metadata.snippet.title).length > 70) { + self.emit('error', new Error("Title cannot be longer than 70 characters")); + } + var options = { url: 'https://' + self.host + self.api + '?uploadType=resumable&part=snippet,status,contentDetails', headers: {